com.amazonaws.services.securityhub.model.AwsCloudWatchAlarmDetails Maven / Gradle / Ivy
Show all versions of aws-java-sdk-securityhub Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.securityhub.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Specifies an alarm and associates it with the specified metric or metric math expression.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AwsCloudWatchAlarmDetails implements Serializable, Cloneable, StructuredPojo {
/**
*
* Indicates whether actions should be executed during any changes to the alarm state.
*
*/
private Boolean actionsEnabled;
/**
*
* The list of actions, specified as Amazon Resource Names (ARNs) to execute when this alarm transitions into an
* ALARM
state from any other state.
*
*/
private java.util.List alarmActions;
/**
*
* The ARN of the alarm.
*
*/
private String alarmArn;
/**
*
* The time stamp of the last update to the alarm configuration.
*
*/
private String alarmConfigurationUpdatedTimestamp;
/**
*
* The description of the alarm.
*
*/
private String alarmDescription;
/**
*
* The name of the alarm. If you don't specify a name, CloudFront generates a unique physical ID and uses that ID
* for the alarm name.
*
*/
private String alarmName;
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*/
private String comparisonOperator;
/**
*
* The number of datapoints that must be breaching to trigger the alarm.
*
*/
private Integer datapointsToAlarm;
/**
*
* The dimensions for the metric associated with the alarm.
*
*/
private java.util.List dimensions;
/**
*
* Used only for alarms based on percentiles. If ignore
, the alarm state does not change during periods
* with too few data points to be statistically significant. If evaluate
or this parameter is not used,
* the alarm is always evaluated and possibly changes state no matter how many data points are available.
*
*/
private String evaluateLowSampleCountPercentile;
/**
*
* The number of periods over which data is compared to the specified threshold.
*
*/
private Integer evaluationPeriods;
/**
*
* The percentile statistic for the metric associated with the alarm.
*
*/
private String extendedStatistic;
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an ARN.
*
*/
private java.util.List insufficientDataActions;
/**
*
* The name of the metric associated with the alarm. This is required for an alarm based on a metric. For an alarm
* based on a math expression, you use Metrics
instead and you can't specify MetricName
.
*
*/
private String metricName;
/**
*
* The namespace of the metric associated with the alarm. This is required for an alarm based on a metric. For an
* alarm based on a math expression, you can't specify Namespace
and you use Metrics
* instead.
*
*/
private String namespace;
/**
*
* The actions to execute when this alarm transitions to the OK
state from any other state. Each action
* is specified as an ARN.
*
*/
private java.util.List okActions;
/**
*
* The period, in seconds, over which the statistic is applied. This is required for an alarm based on a metric.
*
*/
private Integer period;
/**
*
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
* ExtendedStatistic
.
*
*
* For an alarm based on a metric, you must specify either Statistic
or ExtendedStatistic
* but not both.
*
*
* For an alarm based on a math expression, you can't specify Statistic
. Instead, you use
* Metrics
.
*
*/
private String statistic;
/**
*
* The value to compare with the specified statistic.
*
*/
private Double threshold;
/**
*
* n an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND
* function used as the threshold for the alarm.
*
*/
private String thresholdMetricId;
/**
*
* Sets how this alarm is to handle missing data points.
*
*/
private String treatMissingData;
/**
*
* The unit of the metric associated with the alarm.
*
*/
private String unit;
/**
*
* Indicates whether actions should be executed during any changes to the alarm state.
*
*
* @param actionsEnabled
* Indicates whether actions should be executed during any changes to the alarm state.
*/
public void setActionsEnabled(Boolean actionsEnabled) {
this.actionsEnabled = actionsEnabled;
}
/**
*
* Indicates whether actions should be executed during any changes to the alarm state.
*
*
* @return Indicates whether actions should be executed during any changes to the alarm state.
*/
public Boolean getActionsEnabled() {
return this.actionsEnabled;
}
/**
*
* Indicates whether actions should be executed during any changes to the alarm state.
*
*
* @param actionsEnabled
* Indicates whether actions should be executed during any changes to the alarm state.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withActionsEnabled(Boolean actionsEnabled) {
setActionsEnabled(actionsEnabled);
return this;
}
/**
*
* Indicates whether actions should be executed during any changes to the alarm state.
*
*
* @return Indicates whether actions should be executed during any changes to the alarm state.
*/
public Boolean isActionsEnabled() {
return this.actionsEnabled;
}
/**
*
* The list of actions, specified as Amazon Resource Names (ARNs) to execute when this alarm transitions into an
* ALARM
state from any other state.
*
*
* @return The list of actions, specified as Amazon Resource Names (ARNs) to execute when this alarm transitions
* into an ALARM
state from any other state.
*/
public java.util.List getAlarmActions() {
return alarmActions;
}
/**
*
* The list of actions, specified as Amazon Resource Names (ARNs) to execute when this alarm transitions into an
* ALARM
state from any other state.
*
*
* @param alarmActions
* The list of actions, specified as Amazon Resource Names (ARNs) to execute when this alarm transitions into
* an ALARM
state from any other state.
*/
public void setAlarmActions(java.util.Collection alarmActions) {
if (alarmActions == null) {
this.alarmActions = null;
return;
}
this.alarmActions = new java.util.ArrayList(alarmActions);
}
/**
*
* The list of actions, specified as Amazon Resource Names (ARNs) to execute when this alarm transitions into an
* ALARM
state from any other state.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAlarmActions(java.util.Collection)} or {@link #withAlarmActions(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param alarmActions
* The list of actions, specified as Amazon Resource Names (ARNs) to execute when this alarm transitions into
* an ALARM
state from any other state.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withAlarmActions(String... alarmActions) {
if (this.alarmActions == null) {
setAlarmActions(new java.util.ArrayList(alarmActions.length));
}
for (String ele : alarmActions) {
this.alarmActions.add(ele);
}
return this;
}
/**
*
* The list of actions, specified as Amazon Resource Names (ARNs) to execute when this alarm transitions into an
* ALARM
state from any other state.
*
*
* @param alarmActions
* The list of actions, specified as Amazon Resource Names (ARNs) to execute when this alarm transitions into
* an ALARM
state from any other state.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withAlarmActions(java.util.Collection alarmActions) {
setAlarmActions(alarmActions);
return this;
}
/**
*
* The ARN of the alarm.
*
*
* @param alarmArn
* The ARN of the alarm.
*/
public void setAlarmArn(String alarmArn) {
this.alarmArn = alarmArn;
}
/**
*
* The ARN of the alarm.
*
*
* @return The ARN of the alarm.
*/
public String getAlarmArn() {
return this.alarmArn;
}
/**
*
* The ARN of the alarm.
*
*
* @param alarmArn
* The ARN of the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withAlarmArn(String alarmArn) {
setAlarmArn(alarmArn);
return this;
}
/**
*
* The time stamp of the last update to the alarm configuration.
*
*
* @param alarmConfigurationUpdatedTimestamp
* The time stamp of the last update to the alarm configuration.
*/
public void setAlarmConfigurationUpdatedTimestamp(String alarmConfigurationUpdatedTimestamp) {
this.alarmConfigurationUpdatedTimestamp = alarmConfigurationUpdatedTimestamp;
}
/**
*
* The time stamp of the last update to the alarm configuration.
*
*
* @return The time stamp of the last update to the alarm configuration.
*/
public String getAlarmConfigurationUpdatedTimestamp() {
return this.alarmConfigurationUpdatedTimestamp;
}
/**
*
* The time stamp of the last update to the alarm configuration.
*
*
* @param alarmConfigurationUpdatedTimestamp
* The time stamp of the last update to the alarm configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withAlarmConfigurationUpdatedTimestamp(String alarmConfigurationUpdatedTimestamp) {
setAlarmConfigurationUpdatedTimestamp(alarmConfigurationUpdatedTimestamp);
return this;
}
/**
*
* The description of the alarm.
*
*
* @param alarmDescription
* The description of the alarm.
*/
public void setAlarmDescription(String alarmDescription) {
this.alarmDescription = alarmDescription;
}
/**
*
* The description of the alarm.
*
*
* @return The description of the alarm.
*/
public String getAlarmDescription() {
return this.alarmDescription;
}
/**
*
* The description of the alarm.
*
*
* @param alarmDescription
* The description of the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withAlarmDescription(String alarmDescription) {
setAlarmDescription(alarmDescription);
return this;
}
/**
*
* The name of the alarm. If you don't specify a name, CloudFront generates a unique physical ID and uses that ID
* for the alarm name.
*
*
* @param alarmName
* The name of the alarm. If you don't specify a name, CloudFront generates a unique physical ID and uses
* that ID for the alarm name.
*/
public void setAlarmName(String alarmName) {
this.alarmName = alarmName;
}
/**
*
* The name of the alarm. If you don't specify a name, CloudFront generates a unique physical ID and uses that ID
* for the alarm name.
*
*
* @return The name of the alarm. If you don't specify a name, CloudFront generates a unique physical ID and uses
* that ID for the alarm name.
*/
public String getAlarmName() {
return this.alarmName;
}
/**
*
* The name of the alarm. If you don't specify a name, CloudFront generates a unique physical ID and uses that ID
* for the alarm name.
*
*
* @param alarmName
* The name of the alarm. If you don't specify a name, CloudFront generates a unique physical ID and uses
* that ID for the alarm name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withAlarmName(String alarmName) {
setAlarmName(alarmName);
return this;
}
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*
* @param comparisonOperator
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified
* statistic value is used as the first operand.
*/
public void setComparisonOperator(String comparisonOperator) {
this.comparisonOperator = comparisonOperator;
}
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*
* @return The arithmetic operation to use when comparing the specified statistic and threshold. The specified
* statistic value is used as the first operand.
*/
public String getComparisonOperator() {
return this.comparisonOperator;
}
/**
*
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified statistic
* value is used as the first operand.
*
*
* @param comparisonOperator
* The arithmetic operation to use when comparing the specified statistic and threshold. The specified
* statistic value is used as the first operand.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withComparisonOperator(String comparisonOperator) {
setComparisonOperator(comparisonOperator);
return this;
}
/**
*
* The number of datapoints that must be breaching to trigger the alarm.
*
*
* @param datapointsToAlarm
* The number of datapoints that must be breaching to trigger the alarm.
*/
public void setDatapointsToAlarm(Integer datapointsToAlarm) {
this.datapointsToAlarm = datapointsToAlarm;
}
/**
*
* The number of datapoints that must be breaching to trigger the alarm.
*
*
* @return The number of datapoints that must be breaching to trigger the alarm.
*/
public Integer getDatapointsToAlarm() {
return this.datapointsToAlarm;
}
/**
*
* The number of datapoints that must be breaching to trigger the alarm.
*
*
* @param datapointsToAlarm
* The number of datapoints that must be breaching to trigger the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withDatapointsToAlarm(Integer datapointsToAlarm) {
setDatapointsToAlarm(datapointsToAlarm);
return this;
}
/**
*
* The dimensions for the metric associated with the alarm.
*
*
* @return The dimensions for the metric associated with the alarm.
*/
public java.util.List getDimensions() {
return dimensions;
}
/**
*
* The dimensions for the metric associated with the alarm.
*
*
* @param dimensions
* The dimensions for the metric associated with the alarm.
*/
public void setDimensions(java.util.Collection dimensions) {
if (dimensions == null) {
this.dimensions = null;
return;
}
this.dimensions = new java.util.ArrayList(dimensions);
}
/**
*
* The dimensions for the metric associated with the alarm.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDimensions(java.util.Collection)} or {@link #withDimensions(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param dimensions
* The dimensions for the metric associated with the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withDimensions(AwsCloudWatchAlarmDimensionsDetails... dimensions) {
if (this.dimensions == null) {
setDimensions(new java.util.ArrayList(dimensions.length));
}
for (AwsCloudWatchAlarmDimensionsDetails ele : dimensions) {
this.dimensions.add(ele);
}
return this;
}
/**
*
* The dimensions for the metric associated with the alarm.
*
*
* @param dimensions
* The dimensions for the metric associated with the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withDimensions(java.util.Collection dimensions) {
setDimensions(dimensions);
return this;
}
/**
*
* Used only for alarms based on percentiles. If ignore
, the alarm state does not change during periods
* with too few data points to be statistically significant. If evaluate
or this parameter is not used,
* the alarm is always evaluated and possibly changes state no matter how many data points are available.
*
*
* @param evaluateLowSampleCountPercentile
* Used only for alarms based on percentiles. If ignore
, the alarm state does not change during
* periods with too few data points to be statistically significant. If evaluate
or this
* parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data
* points are available.
*/
public void setEvaluateLowSampleCountPercentile(String evaluateLowSampleCountPercentile) {
this.evaluateLowSampleCountPercentile = evaluateLowSampleCountPercentile;
}
/**
*
* Used only for alarms based on percentiles. If ignore
, the alarm state does not change during periods
* with too few data points to be statistically significant. If evaluate
or this parameter is not used,
* the alarm is always evaluated and possibly changes state no matter how many data points are available.
*
*
* @return Used only for alarms based on percentiles. If ignore
, the alarm state does not change during
* periods with too few data points to be statistically significant. If evaluate
or this
* parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data
* points are available.
*/
public String getEvaluateLowSampleCountPercentile() {
return this.evaluateLowSampleCountPercentile;
}
/**
*
* Used only for alarms based on percentiles. If ignore
, the alarm state does not change during periods
* with too few data points to be statistically significant. If evaluate
or this parameter is not used,
* the alarm is always evaluated and possibly changes state no matter how many data points are available.
*
*
* @param evaluateLowSampleCountPercentile
* Used only for alarms based on percentiles. If ignore
, the alarm state does not change during
* periods with too few data points to be statistically significant. If evaluate
or this
* parameter is not used, the alarm is always evaluated and possibly changes state no matter how many data
* points are available.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withEvaluateLowSampleCountPercentile(String evaluateLowSampleCountPercentile) {
setEvaluateLowSampleCountPercentile(evaluateLowSampleCountPercentile);
return this;
}
/**
*
* The number of periods over which data is compared to the specified threshold.
*
*
* @param evaluationPeriods
* The number of periods over which data is compared to the specified threshold.
*/
public void setEvaluationPeriods(Integer evaluationPeriods) {
this.evaluationPeriods = evaluationPeriods;
}
/**
*
* The number of periods over which data is compared to the specified threshold.
*
*
* @return The number of periods over which data is compared to the specified threshold.
*/
public Integer getEvaluationPeriods() {
return this.evaluationPeriods;
}
/**
*
* The number of periods over which data is compared to the specified threshold.
*
*
* @param evaluationPeriods
* The number of periods over which data is compared to the specified threshold.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withEvaluationPeriods(Integer evaluationPeriods) {
setEvaluationPeriods(evaluationPeriods);
return this;
}
/**
*
* The percentile statistic for the metric associated with the alarm.
*
*
* @param extendedStatistic
* The percentile statistic for the metric associated with the alarm.
*/
public void setExtendedStatistic(String extendedStatistic) {
this.extendedStatistic = extendedStatistic;
}
/**
*
* The percentile statistic for the metric associated with the alarm.
*
*
* @return The percentile statistic for the metric associated with the alarm.
*/
public String getExtendedStatistic() {
return this.extendedStatistic;
}
/**
*
* The percentile statistic for the metric associated with the alarm.
*
*
* @param extendedStatistic
* The percentile statistic for the metric associated with the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withExtendedStatistic(String extendedStatistic) {
setExtendedStatistic(extendedStatistic);
return this;
}
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an ARN.
*
*
* @return The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any
* other state. Each action is specified as an ARN.
*/
public java.util.List getInsufficientDataActions() {
return insufficientDataActions;
}
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an ARN.
*
*
* @param insufficientDataActions
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any
* other state. Each action is specified as an ARN.
*/
public void setInsufficientDataActions(java.util.Collection insufficientDataActions) {
if (insufficientDataActions == null) {
this.insufficientDataActions = null;
return;
}
this.insufficientDataActions = new java.util.ArrayList(insufficientDataActions);
}
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an ARN.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setInsufficientDataActions(java.util.Collection)} or
* {@link #withInsufficientDataActions(java.util.Collection)} if you want to override the existing values.
*
*
* @param insufficientDataActions
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any
* other state. Each action is specified as an ARN.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withInsufficientDataActions(String... insufficientDataActions) {
if (this.insufficientDataActions == null) {
setInsufficientDataActions(new java.util.ArrayList(insufficientDataActions.length));
}
for (String ele : insufficientDataActions) {
this.insufficientDataActions.add(ele);
}
return this;
}
/**
*
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any other
* state. Each action is specified as an ARN.
*
*
* @param insufficientDataActions
* The actions to execute when this alarm transitions to the INSUFFICIENT_DATA
state from any
* other state. Each action is specified as an ARN.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withInsufficientDataActions(java.util.Collection insufficientDataActions) {
setInsufficientDataActions(insufficientDataActions);
return this;
}
/**
*
* The name of the metric associated with the alarm. This is required for an alarm based on a metric. For an alarm
* based on a math expression, you use Metrics
instead and you can't specify MetricName
.
*
*
* @param metricName
* The name of the metric associated with the alarm. This is required for an alarm based on a metric. For an
* alarm based on a math expression, you use Metrics
instead and you can't specify
* MetricName
.
*/
public void setMetricName(String metricName) {
this.metricName = metricName;
}
/**
*
* The name of the metric associated with the alarm. This is required for an alarm based on a metric. For an alarm
* based on a math expression, you use Metrics
instead and you can't specify MetricName
.
*
*
* @return The name of the metric associated with the alarm. This is required for an alarm based on a metric. For an
* alarm based on a math expression, you use Metrics
instead and you can't specify
* MetricName
.
*/
public String getMetricName() {
return this.metricName;
}
/**
*
* The name of the metric associated with the alarm. This is required for an alarm based on a metric. For an alarm
* based on a math expression, you use Metrics
instead and you can't specify MetricName
.
*
*
* @param metricName
* The name of the metric associated with the alarm. This is required for an alarm based on a metric. For an
* alarm based on a math expression, you use Metrics
instead and you can't specify
* MetricName
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withMetricName(String metricName) {
setMetricName(metricName);
return this;
}
/**
*
* The namespace of the metric associated with the alarm. This is required for an alarm based on a metric. For an
* alarm based on a math expression, you can't specify Namespace
and you use Metrics
* instead.
*
*
* @param namespace
* The namespace of the metric associated with the alarm. This is required for an alarm based on a metric.
* For an alarm based on a math expression, you can't specify Namespace
and you use
* Metrics
instead.
*/
public void setNamespace(String namespace) {
this.namespace = namespace;
}
/**
*
* The namespace of the metric associated with the alarm. This is required for an alarm based on a metric. For an
* alarm based on a math expression, you can't specify Namespace
and you use Metrics
* instead.
*
*
* @return The namespace of the metric associated with the alarm. This is required for an alarm based on a metric.
* For an alarm based on a math expression, you can't specify Namespace
and you use
* Metrics
instead.
*/
public String getNamespace() {
return this.namespace;
}
/**
*
* The namespace of the metric associated with the alarm. This is required for an alarm based on a metric. For an
* alarm based on a math expression, you can't specify Namespace
and you use Metrics
* instead.
*
*
* @param namespace
* The namespace of the metric associated with the alarm. This is required for an alarm based on a metric.
* For an alarm based on a math expression, you can't specify Namespace
and you use
* Metrics
instead.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withNamespace(String namespace) {
setNamespace(namespace);
return this;
}
/**
*
* The actions to execute when this alarm transitions to the OK
state from any other state. Each action
* is specified as an ARN.
*
*
* @return The actions to execute when this alarm transitions to the OK
state from any other state.
* Each action is specified as an ARN.
*/
public java.util.List getOkActions() {
return okActions;
}
/**
*
* The actions to execute when this alarm transitions to the OK
state from any other state. Each action
* is specified as an ARN.
*
*
* @param okActions
* The actions to execute when this alarm transitions to the OK
state from any other state. Each
* action is specified as an ARN.
*/
public void setOkActions(java.util.Collection okActions) {
if (okActions == null) {
this.okActions = null;
return;
}
this.okActions = new java.util.ArrayList(okActions);
}
/**
*
* The actions to execute when this alarm transitions to the OK
state from any other state. Each action
* is specified as an ARN.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setOkActions(java.util.Collection)} or {@link #withOkActions(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param okActions
* The actions to execute when this alarm transitions to the OK
state from any other state. Each
* action is specified as an ARN.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withOkActions(String... okActions) {
if (this.okActions == null) {
setOkActions(new java.util.ArrayList(okActions.length));
}
for (String ele : okActions) {
this.okActions.add(ele);
}
return this;
}
/**
*
* The actions to execute when this alarm transitions to the OK
state from any other state. Each action
* is specified as an ARN.
*
*
* @param okActions
* The actions to execute when this alarm transitions to the OK
state from any other state. Each
* action is specified as an ARN.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withOkActions(java.util.Collection okActions) {
setOkActions(okActions);
return this;
}
/**
*
* The period, in seconds, over which the statistic is applied. This is required for an alarm based on a metric.
*
*
* @param period
* The period, in seconds, over which the statistic is applied. This is required for an alarm based on a
* metric.
*/
public void setPeriod(Integer period) {
this.period = period;
}
/**
*
* The period, in seconds, over which the statistic is applied. This is required for an alarm based on a metric.
*
*
* @return The period, in seconds, over which the statistic is applied. This is required for an alarm based on a
* metric.
*/
public Integer getPeriod() {
return this.period;
}
/**
*
* The period, in seconds, over which the statistic is applied. This is required for an alarm based on a metric.
*
*
* @param period
* The period, in seconds, over which the statistic is applied. This is required for an alarm based on a
* metric.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withPeriod(Integer period) {
setPeriod(period);
return this;
}
/**
*
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
* ExtendedStatistic
.
*
*
* For an alarm based on a metric, you must specify either Statistic
or ExtendedStatistic
* but not both.
*
*
* For an alarm based on a math expression, you can't specify Statistic
. Instead, you use
* Metrics
.
*
*
* @param statistic
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics,
* use ExtendedStatistic
.
*
* For an alarm based on a metric, you must specify either Statistic
or
* ExtendedStatistic
but not both.
*
*
* For an alarm based on a math expression, you can't specify Statistic
. Instead, you use
* Metrics
.
*/
public void setStatistic(String statistic) {
this.statistic = statistic;
}
/**
*
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
* ExtendedStatistic
.
*
*
* For an alarm based on a metric, you must specify either Statistic
or ExtendedStatistic
* but not both.
*
*
* For an alarm based on a math expression, you can't specify Statistic
. Instead, you use
* Metrics
.
*
*
* @return The statistic for the metric associated with the alarm, other than percentile. For percentile statistics,
* use ExtendedStatistic
.
*
* For an alarm based on a metric, you must specify either Statistic
or
* ExtendedStatistic
but not both.
*
*
* For an alarm based on a math expression, you can't specify Statistic
. Instead, you use
* Metrics
.
*/
public String getStatistic() {
return this.statistic;
}
/**
*
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics, use
* ExtendedStatistic
.
*
*
* For an alarm based on a metric, you must specify either Statistic
or ExtendedStatistic
* but not both.
*
*
* For an alarm based on a math expression, you can't specify Statistic
. Instead, you use
* Metrics
.
*
*
* @param statistic
* The statistic for the metric associated with the alarm, other than percentile. For percentile statistics,
* use ExtendedStatistic
.
*
* For an alarm based on a metric, you must specify either Statistic
or
* ExtendedStatistic
but not both.
*
*
* For an alarm based on a math expression, you can't specify Statistic
. Instead, you use
* Metrics
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withStatistic(String statistic) {
setStatistic(statistic);
return this;
}
/**
*
* The value to compare with the specified statistic.
*
*
* @param threshold
* The value to compare with the specified statistic.
*/
public void setThreshold(Double threshold) {
this.threshold = threshold;
}
/**
*
* The value to compare with the specified statistic.
*
*
* @return The value to compare with the specified statistic.
*/
public Double getThreshold() {
return this.threshold;
}
/**
*
* The value to compare with the specified statistic.
*
*
* @param threshold
* The value to compare with the specified statistic.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withThreshold(Double threshold) {
setThreshold(threshold);
return this;
}
/**
*
* n an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND
* function used as the threshold for the alarm.
*
*
* @param thresholdMetricId
* n an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND
* function used as the threshold for the alarm.
*/
public void setThresholdMetricId(String thresholdMetricId) {
this.thresholdMetricId = thresholdMetricId;
}
/**
*
* n an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND
* function used as the threshold for the alarm.
*
*
* @return n an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND
* function used as the threshold for the alarm.
*/
public String getThresholdMetricId() {
return this.thresholdMetricId;
}
/**
*
* n an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND
* function used as the threshold for the alarm.
*
*
* @param thresholdMetricId
* n an alarm based on an anomaly detection model, this is the ID of the ANOMALY_DETECTION_BAND
* function used as the threshold for the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withThresholdMetricId(String thresholdMetricId) {
setThresholdMetricId(thresholdMetricId);
return this;
}
/**
*
* Sets how this alarm is to handle missing data points.
*
*
* @param treatMissingData
* Sets how this alarm is to handle missing data points.
*/
public void setTreatMissingData(String treatMissingData) {
this.treatMissingData = treatMissingData;
}
/**
*
* Sets how this alarm is to handle missing data points.
*
*
* @return Sets how this alarm is to handle missing data points.
*/
public String getTreatMissingData() {
return this.treatMissingData;
}
/**
*
* Sets how this alarm is to handle missing data points.
*
*
* @param treatMissingData
* Sets how this alarm is to handle missing data points.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withTreatMissingData(String treatMissingData) {
setTreatMissingData(treatMissingData);
return this;
}
/**
*
* The unit of the metric associated with the alarm.
*
*
* @param unit
* The unit of the metric associated with the alarm.
*/
public void setUnit(String unit) {
this.unit = unit;
}
/**
*
* The unit of the metric associated with the alarm.
*
*
* @return The unit of the metric associated with the alarm.
*/
public String getUnit() {
return this.unit;
}
/**
*
* The unit of the metric associated with the alarm.
*
*
* @param unit
* The unit of the metric associated with the alarm.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AwsCloudWatchAlarmDetails withUnit(String unit) {
setUnit(unit);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getActionsEnabled() != null)
sb.append("ActionsEnabled: ").append(getActionsEnabled()).append(",");
if (getAlarmActions() != null)
sb.append("AlarmActions: ").append(getAlarmActions()).append(",");
if (getAlarmArn() != null)
sb.append("AlarmArn: ").append(getAlarmArn()).append(",");
if (getAlarmConfigurationUpdatedTimestamp() != null)
sb.append("AlarmConfigurationUpdatedTimestamp: ").append(getAlarmConfigurationUpdatedTimestamp()).append(",");
if (getAlarmDescription() != null)
sb.append("AlarmDescription: ").append(getAlarmDescription()).append(",");
if (getAlarmName() != null)
sb.append("AlarmName: ").append(getAlarmName()).append(",");
if (getComparisonOperator() != null)
sb.append("ComparisonOperator: ").append(getComparisonOperator()).append(",");
if (getDatapointsToAlarm() != null)
sb.append("DatapointsToAlarm: ").append(getDatapointsToAlarm()).append(",");
if (getDimensions() != null)
sb.append("Dimensions: ").append(getDimensions()).append(",");
if (getEvaluateLowSampleCountPercentile() != null)
sb.append("EvaluateLowSampleCountPercentile: ").append(getEvaluateLowSampleCountPercentile()).append(",");
if (getEvaluationPeriods() != null)
sb.append("EvaluationPeriods: ").append(getEvaluationPeriods()).append(",");
if (getExtendedStatistic() != null)
sb.append("ExtendedStatistic: ").append(getExtendedStatistic()).append(",");
if (getInsufficientDataActions() != null)
sb.append("InsufficientDataActions: ").append(getInsufficientDataActions()).append(",");
if (getMetricName() != null)
sb.append("MetricName: ").append(getMetricName()).append(",");
if (getNamespace() != null)
sb.append("Namespace: ").append(getNamespace()).append(",");
if (getOkActions() != null)
sb.append("OkActions: ").append(getOkActions()).append(",");
if (getPeriod() != null)
sb.append("Period: ").append(getPeriod()).append(",");
if (getStatistic() != null)
sb.append("Statistic: ").append(getStatistic()).append(",");
if (getThreshold() != null)
sb.append("Threshold: ").append(getThreshold()).append(",");
if (getThresholdMetricId() != null)
sb.append("ThresholdMetricId: ").append(getThresholdMetricId()).append(",");
if (getTreatMissingData() != null)
sb.append("TreatMissingData: ").append(getTreatMissingData()).append(",");
if (getUnit() != null)
sb.append("Unit: ").append(getUnit());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AwsCloudWatchAlarmDetails == false)
return false;
AwsCloudWatchAlarmDetails other = (AwsCloudWatchAlarmDetails) obj;
if (other.getActionsEnabled() == null ^ this.getActionsEnabled() == null)
return false;
if (other.getActionsEnabled() != null && other.getActionsEnabled().equals(this.getActionsEnabled()) == false)
return false;
if (other.getAlarmActions() == null ^ this.getAlarmActions() == null)
return false;
if (other.getAlarmActions() != null && other.getAlarmActions().equals(this.getAlarmActions()) == false)
return false;
if (other.getAlarmArn() == null ^ this.getAlarmArn() == null)
return false;
if (other.getAlarmArn() != null && other.getAlarmArn().equals(this.getAlarmArn()) == false)
return false;
if (other.getAlarmConfigurationUpdatedTimestamp() == null ^ this.getAlarmConfigurationUpdatedTimestamp() == null)
return false;
if (other.getAlarmConfigurationUpdatedTimestamp() != null
&& other.getAlarmConfigurationUpdatedTimestamp().equals(this.getAlarmConfigurationUpdatedTimestamp()) == false)
return false;
if (other.getAlarmDescription() == null ^ this.getAlarmDescription() == null)
return false;
if (other.getAlarmDescription() != null && other.getAlarmDescription().equals(this.getAlarmDescription()) == false)
return false;
if (other.getAlarmName() == null ^ this.getAlarmName() == null)
return false;
if (other.getAlarmName() != null && other.getAlarmName().equals(this.getAlarmName()) == false)
return false;
if (other.getComparisonOperator() == null ^ this.getComparisonOperator() == null)
return false;
if (other.getComparisonOperator() != null && other.getComparisonOperator().equals(this.getComparisonOperator()) == false)
return false;
if (other.getDatapointsToAlarm() == null ^ this.getDatapointsToAlarm() == null)
return false;
if (other.getDatapointsToAlarm() != null && other.getDatapointsToAlarm().equals(this.getDatapointsToAlarm()) == false)
return false;
if (other.getDimensions() == null ^ this.getDimensions() == null)
return false;
if (other.getDimensions() != null && other.getDimensions().equals(this.getDimensions()) == false)
return false;
if (other.getEvaluateLowSampleCountPercentile() == null ^ this.getEvaluateLowSampleCountPercentile() == null)
return false;
if (other.getEvaluateLowSampleCountPercentile() != null
&& other.getEvaluateLowSampleCountPercentile().equals(this.getEvaluateLowSampleCountPercentile()) == false)
return false;
if (other.getEvaluationPeriods() == null ^ this.getEvaluationPeriods() == null)
return false;
if (other.getEvaluationPeriods() != null && other.getEvaluationPeriods().equals(this.getEvaluationPeriods()) == false)
return false;
if (other.getExtendedStatistic() == null ^ this.getExtendedStatistic() == null)
return false;
if (other.getExtendedStatistic() != null && other.getExtendedStatistic().equals(this.getExtendedStatistic()) == false)
return false;
if (other.getInsufficientDataActions() == null ^ this.getInsufficientDataActions() == null)
return false;
if (other.getInsufficientDataActions() != null && other.getInsufficientDataActions().equals(this.getInsufficientDataActions()) == false)
return false;
if (other.getMetricName() == null ^ this.getMetricName() == null)
return false;
if (other.getMetricName() != null && other.getMetricName().equals(this.getMetricName()) == false)
return false;
if (other.getNamespace() == null ^ this.getNamespace() == null)
return false;
if (other.getNamespace() != null && other.getNamespace().equals(this.getNamespace()) == false)
return false;
if (other.getOkActions() == null ^ this.getOkActions() == null)
return false;
if (other.getOkActions() != null && other.getOkActions().equals(this.getOkActions()) == false)
return false;
if (other.getPeriod() == null ^ this.getPeriod() == null)
return false;
if (other.getPeriod() != null && other.getPeriod().equals(this.getPeriod()) == false)
return false;
if (other.getStatistic() == null ^ this.getStatistic() == null)
return false;
if (other.getStatistic() != null && other.getStatistic().equals(this.getStatistic()) == false)
return false;
if (other.getThreshold() == null ^ this.getThreshold() == null)
return false;
if (other.getThreshold() != null && other.getThreshold().equals(this.getThreshold()) == false)
return false;
if (other.getThresholdMetricId() == null ^ this.getThresholdMetricId() == null)
return false;
if (other.getThresholdMetricId() != null && other.getThresholdMetricId().equals(this.getThresholdMetricId()) == false)
return false;
if (other.getTreatMissingData() == null ^ this.getTreatMissingData() == null)
return false;
if (other.getTreatMissingData() != null && other.getTreatMissingData().equals(this.getTreatMissingData()) == false)
return false;
if (other.getUnit() == null ^ this.getUnit() == null)
return false;
if (other.getUnit() != null && other.getUnit().equals(this.getUnit()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getActionsEnabled() == null) ? 0 : getActionsEnabled().hashCode());
hashCode = prime * hashCode + ((getAlarmActions() == null) ? 0 : getAlarmActions().hashCode());
hashCode = prime * hashCode + ((getAlarmArn() == null) ? 0 : getAlarmArn().hashCode());
hashCode = prime * hashCode + ((getAlarmConfigurationUpdatedTimestamp() == null) ? 0 : getAlarmConfigurationUpdatedTimestamp().hashCode());
hashCode = prime * hashCode + ((getAlarmDescription() == null) ? 0 : getAlarmDescription().hashCode());
hashCode = prime * hashCode + ((getAlarmName() == null) ? 0 : getAlarmName().hashCode());
hashCode = prime * hashCode + ((getComparisonOperator() == null) ? 0 : getComparisonOperator().hashCode());
hashCode = prime * hashCode + ((getDatapointsToAlarm() == null) ? 0 : getDatapointsToAlarm().hashCode());
hashCode = prime * hashCode + ((getDimensions() == null) ? 0 : getDimensions().hashCode());
hashCode = prime * hashCode + ((getEvaluateLowSampleCountPercentile() == null) ? 0 : getEvaluateLowSampleCountPercentile().hashCode());
hashCode = prime * hashCode + ((getEvaluationPeriods() == null) ? 0 : getEvaluationPeriods().hashCode());
hashCode = prime * hashCode + ((getExtendedStatistic() == null) ? 0 : getExtendedStatistic().hashCode());
hashCode = prime * hashCode + ((getInsufficientDataActions() == null) ? 0 : getInsufficientDataActions().hashCode());
hashCode = prime * hashCode + ((getMetricName() == null) ? 0 : getMetricName().hashCode());
hashCode = prime * hashCode + ((getNamespace() == null) ? 0 : getNamespace().hashCode());
hashCode = prime * hashCode + ((getOkActions() == null) ? 0 : getOkActions().hashCode());
hashCode = prime * hashCode + ((getPeriod() == null) ? 0 : getPeriod().hashCode());
hashCode = prime * hashCode + ((getStatistic() == null) ? 0 : getStatistic().hashCode());
hashCode = prime * hashCode + ((getThreshold() == null) ? 0 : getThreshold().hashCode());
hashCode = prime * hashCode + ((getThresholdMetricId() == null) ? 0 : getThresholdMetricId().hashCode());
hashCode = prime * hashCode + ((getTreatMissingData() == null) ? 0 : getTreatMissingData().hashCode());
hashCode = prime * hashCode + ((getUnit() == null) ? 0 : getUnit().hashCode());
return hashCode;
}
@Override
public AwsCloudWatchAlarmDetails clone() {
try {
return (AwsCloudWatchAlarmDetails) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.securityhub.model.transform.AwsCloudWatchAlarmDetailsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}