io.github.cdklabs.cdkmonitoringconstructs.AnomalyDetectionThreshold Maven / Gradle / Ivy
package io.github.cdklabs.cdkmonitoringconstructs;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-24T17:32:51.775Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdkmonitoringconstructs.$Module.class, fqn = "cdk-monitoring-constructs.AnomalyDetectionThreshold")
@software.amazon.jsii.Jsii.Proxy(AnomalyDetectionThreshold.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface AnomalyDetectionThreshold extends software.amazon.jsii.JsiiSerializable, io.github.cdklabs.cdkmonitoringconstructs.CustomAlarmThreshold {
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.Boolean getAlarmWhenAboveTheBand();
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.Boolean getAlarmWhenBelowTheBand();
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@org.jetbrains.annotations.NotNull java.lang.Number getStandardDeviationForAlarm();
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getAdditionalDescription() {
return null;
}
/**
* @return a {@link Builder} of {@link AnomalyDetectionThreshold}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link AnomalyDetectionThreshold}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Boolean alarmWhenAboveTheBand;
java.lang.Boolean alarmWhenBelowTheBand;
java.lang.Number standardDeviationForAlarm;
java.lang.String additionalDescription;
io.github.cdklabs.cdkmonitoringconstructs.IAlarmActionStrategy actionOverride;
java.lang.Boolean actionsEnabled;
java.lang.String alarmDescriptionOverride;
java.lang.String alarmNameOverride;
software.amazon.awscdk.services.cloudwatch.ComparisonOperator comparisonOperatorOverride;
java.util.Map customParams;
java.util.List customTags;
java.lang.Number datapointsToAlarm;
java.lang.String dedupeStringOverride;
java.lang.String documentationLink;
java.lang.Boolean evaluateLowSampleCountPercentile;
java.lang.Number evaluationPeriods;
java.lang.Boolean fillAlarmRange;
io.github.cdklabs.cdkmonitoringconstructs.IMetricAdjuster metricAdjuster;
java.lang.Number minMetricSamplesToAlarm;
java.lang.Number minSampleCountToEvaluateDatapoint;
java.lang.String overrideAnnotationColor;
java.lang.String overrideAnnotationLabel;
java.lang.Boolean overrideAnnotationVisibility;
software.amazon.awscdk.Duration period;
java.lang.String runbookLink;
software.amazon.awscdk.services.cloudwatch.TreatMissingData treatMissingDataOverride;
/**
* Sets the value of {@link AnomalyDetectionThreshold#getAlarmWhenAboveTheBand}
* @param alarmWhenAboveTheBand the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder alarmWhenAboveTheBand(java.lang.Boolean alarmWhenAboveTheBand) {
this.alarmWhenAboveTheBand = alarmWhenAboveTheBand;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getAlarmWhenBelowTheBand}
* @param alarmWhenBelowTheBand the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder alarmWhenBelowTheBand(java.lang.Boolean alarmWhenBelowTheBand) {
this.alarmWhenBelowTheBand = alarmWhenBelowTheBand;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getStandardDeviationForAlarm}
* @param standardDeviationForAlarm the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder standardDeviationForAlarm(java.lang.Number standardDeviationForAlarm) {
this.standardDeviationForAlarm = standardDeviationForAlarm;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getAdditionalDescription}
* @param additionalDescription the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder additionalDescription(java.lang.String additionalDescription) {
this.additionalDescription = additionalDescription;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getActionOverride}
* @param actionOverride Allows to override the default alarm action.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder actionOverride(io.github.cdklabs.cdkmonitoringconstructs.IAlarmActionStrategy actionOverride) {
this.actionOverride = actionOverride;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getActionsEnabled}
* @param actionsEnabled Enables the configured CloudWatch alarm ticketing actions.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder actionsEnabled(java.lang.Boolean actionsEnabled) {
this.actionsEnabled = actionsEnabled;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getAlarmDescriptionOverride}
* @param alarmDescriptionOverride A text included in the generated ticket description body, which fully replaces the generated text.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder alarmDescriptionOverride(java.lang.String alarmDescriptionOverride) {
this.alarmDescriptionOverride = alarmDescriptionOverride;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getAlarmNameOverride}
* @param alarmNameOverride If this is defined, the alarm name is set to this exact value.
* Please be aware that you need to specify prefix for different stages (Beta, Prod...) and regions (EU, NA...) manually.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder alarmNameOverride(java.lang.String alarmNameOverride) {
this.alarmNameOverride = alarmNameOverride;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getComparisonOperatorOverride}
* @param comparisonOperatorOverride Comparison operator used to compare actual value against the threshold.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder comparisonOperatorOverride(software.amazon.awscdk.services.cloudwatch.ComparisonOperator comparisonOperatorOverride) {
this.comparisonOperatorOverride = comparisonOperatorOverride;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getCustomParams}
* @param customParams This allows user to attach custom parameters to this alarm, which can later be accessed from the "useCreatedAlarms" method.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder customParams(java.util.Map customParams) {
this.customParams = (java.util.Map)customParams;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getCustomTags}
* @param customTags This allows user to attach custom values to this alarm, which can later be accessed from the "useCreatedAlarms" method.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder customTags(java.util.List customTags) {
this.customTags = customTags;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getDatapointsToAlarm}
* @param datapointsToAlarm Number of breaches required to transition into an ALARM state.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder datapointsToAlarm(java.lang.Number datapointsToAlarm) {
this.datapointsToAlarm = datapointsToAlarm;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getDedupeStringOverride}
* @param dedupeStringOverride If this is defined, the alarm dedupe string is set to this exact value.
* Please be aware that you need to handle deduping for different stages (Beta, Prod...) and regions (EU, NA...) manually.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder dedupeStringOverride(java.lang.String dedupeStringOverride) {
this.dedupeStringOverride = dedupeStringOverride;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getDocumentationLink}
* @param documentationLink An optional link included in the generated ticket description body.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder documentationLink(java.lang.String documentationLink) {
this.documentationLink = documentationLink;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getEvaluateLowSampleCountPercentile}
* @param evaluateLowSampleCountPercentile Used only for alarms based on percentiles.
* If you specify false
, the alarm state does not change during periods with too few data points to be statistically significant.
* If you specify true
, the alarm is always evaluated and possibly changes state no matter how many data points are available.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder evaluateLowSampleCountPercentile(java.lang.Boolean evaluateLowSampleCountPercentile) {
this.evaluateLowSampleCountPercentile = evaluateLowSampleCountPercentile;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getEvaluationPeriods}
* @param evaluationPeriods Number of periods to consider when checking the number of breaching datapoints.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder evaluationPeriods(java.lang.Number evaluationPeriods) {
this.evaluationPeriods = evaluationPeriods;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getFillAlarmRange}
* @param fillAlarmRange Indicates whether the alarming range of values should be highlighted in the widget.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder fillAlarmRange(java.lang.Boolean fillAlarmRange) {
this.fillAlarmRange = fillAlarmRange;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getMetricAdjuster}
* @param metricAdjuster If specified, adjusts the metric before creating an alarm from it.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder metricAdjuster(io.github.cdklabs.cdkmonitoringconstructs.IMetricAdjuster metricAdjuster) {
this.metricAdjuster = metricAdjuster;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getMinMetricSamplesToAlarm}
* @param minMetricSamplesToAlarm Specifies how many samples (N) of the metric is needed to trigger the alarm.
* If this property is specified, a composite alarm is created of the following:
*
*
* - The original alarm, created without this property being used; this alarm will have no actions set.
* - A secondary alarm, which will monitor the same metric with the N (SampleCount) statistic, checking the sample count.
*
* This composite alarm will be returned as a result and uses the specified alarm actions.
* @return {@code this}
* @deprecated Use minSampleCountToEvaluateDatapoint instead. minMetricSamplesAlarm uses different evaluation
period for its child alarms, so it doesn't guarantee that each datapoint in the evaluation period has
sufficient number of samples
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public Builder minMetricSamplesToAlarm(java.lang.Number minMetricSamplesToAlarm) {
this.minMetricSamplesToAlarm = minMetricSamplesToAlarm;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getMinSampleCountToEvaluateDatapoint}
* @param minSampleCountToEvaluateDatapoint Specifies how many samples (N) of the metric is needed in a datapoint to be evaluated for alarming.
* If this property is specified, your metric will be subject to MathExpression that will add an IF condition
* to your metric to make sure that each datapoint is evaluated only if it has sufficient number of samples.
* If the number of samples is not sufficient, the datapoint will be treated as missing data and will be evaluated
* according to the treatMissingData parameter.
* If specified, deprecated minMetricSamplesToAlarm has no effect.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder minSampleCountToEvaluateDatapoint(java.lang.Number minSampleCountToEvaluateDatapoint) {
this.minSampleCountToEvaluateDatapoint = minSampleCountToEvaluateDatapoint;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getOverrideAnnotationColor}
* @param overrideAnnotationColor If specified, it modifies the final alarm annotation color.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder overrideAnnotationColor(java.lang.String overrideAnnotationColor) {
this.overrideAnnotationColor = overrideAnnotationColor;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getOverrideAnnotationLabel}
* @param overrideAnnotationLabel If specified, it modifies the final alarm annotation label.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder overrideAnnotationLabel(java.lang.String overrideAnnotationLabel) {
this.overrideAnnotationLabel = overrideAnnotationLabel;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getOverrideAnnotationVisibility}
* @param overrideAnnotationVisibility If specified, it modifies the final alarm annotation visibility.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder overrideAnnotationVisibility(java.lang.Boolean overrideAnnotationVisibility) {
this.overrideAnnotationVisibility = overrideAnnotationVisibility;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getPeriod}
* @param period Period override for the metric to alarm on.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder period(software.amazon.awscdk.Duration period) {
this.period = period;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getRunbookLink}
* @param runbookLink An optional link included in the generated ticket description body.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder runbookLink(java.lang.String runbookLink) {
this.runbookLink = runbookLink;
return this;
}
/**
* Sets the value of {@link AnomalyDetectionThreshold#getTreatMissingDataOverride}
* @param treatMissingDataOverride Behaviour in case the metric data is missing.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder treatMissingDataOverride(software.amazon.awscdk.services.cloudwatch.TreatMissingData treatMissingDataOverride) {
this.treatMissingDataOverride = treatMissingDataOverride;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link AnomalyDetectionThreshold}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public AnomalyDetectionThreshold build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link AnomalyDetectionThreshold}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements AnomalyDetectionThreshold {
private final java.lang.Boolean alarmWhenAboveTheBand;
private final java.lang.Boolean alarmWhenBelowTheBand;
private final java.lang.Number standardDeviationForAlarm;
private final java.lang.String additionalDescription;
private final io.github.cdklabs.cdkmonitoringconstructs.IAlarmActionStrategy actionOverride;
private final java.lang.Boolean actionsEnabled;
private final java.lang.String alarmDescriptionOverride;
private final java.lang.String alarmNameOverride;
private final software.amazon.awscdk.services.cloudwatch.ComparisonOperator comparisonOperatorOverride;
private final java.util.Map customParams;
private final java.util.List customTags;
private final java.lang.Number datapointsToAlarm;
private final java.lang.String dedupeStringOverride;
private final java.lang.String documentationLink;
private final java.lang.Boolean evaluateLowSampleCountPercentile;
private final java.lang.Number evaluationPeriods;
private final java.lang.Boolean fillAlarmRange;
private final io.github.cdklabs.cdkmonitoringconstructs.IMetricAdjuster metricAdjuster;
private final java.lang.Number minMetricSamplesToAlarm;
private final java.lang.Number minSampleCountToEvaluateDatapoint;
private final java.lang.String overrideAnnotationColor;
private final java.lang.String overrideAnnotationLabel;
private final java.lang.Boolean overrideAnnotationVisibility;
private final software.amazon.awscdk.Duration period;
private final java.lang.String runbookLink;
private final software.amazon.awscdk.services.cloudwatch.TreatMissingData treatMissingDataOverride;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.alarmWhenAboveTheBand = software.amazon.jsii.Kernel.get(this, "alarmWhenAboveTheBand", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.alarmWhenBelowTheBand = software.amazon.jsii.Kernel.get(this, "alarmWhenBelowTheBand", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.standardDeviationForAlarm = software.amazon.jsii.Kernel.get(this, "standardDeviationForAlarm", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.additionalDescription = software.amazon.jsii.Kernel.get(this, "additionalDescription", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.actionOverride = software.amazon.jsii.Kernel.get(this, "actionOverride", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkmonitoringconstructs.IAlarmActionStrategy.class));
this.actionsEnabled = software.amazon.jsii.Kernel.get(this, "actionsEnabled", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.alarmDescriptionOverride = software.amazon.jsii.Kernel.get(this, "alarmDescriptionOverride", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.alarmNameOverride = software.amazon.jsii.Kernel.get(this, "alarmNameOverride", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.comparisonOperatorOverride = software.amazon.jsii.Kernel.get(this, "comparisonOperatorOverride", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cloudwatch.ComparisonOperator.class));
this.customParams = software.amazon.jsii.Kernel.get(this, "customParams", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.Object.class)));
this.customTags = software.amazon.jsii.Kernel.get(this, "customTags", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.datapointsToAlarm = software.amazon.jsii.Kernel.get(this, "datapointsToAlarm", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.dedupeStringOverride = software.amazon.jsii.Kernel.get(this, "dedupeStringOverride", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.documentationLink = software.amazon.jsii.Kernel.get(this, "documentationLink", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.evaluateLowSampleCountPercentile = software.amazon.jsii.Kernel.get(this, "evaluateLowSampleCountPercentile", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.evaluationPeriods = software.amazon.jsii.Kernel.get(this, "evaluationPeriods", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.fillAlarmRange = software.amazon.jsii.Kernel.get(this, "fillAlarmRange", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.metricAdjuster = software.amazon.jsii.Kernel.get(this, "metricAdjuster", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkmonitoringconstructs.IMetricAdjuster.class));
this.minMetricSamplesToAlarm = software.amazon.jsii.Kernel.get(this, "minMetricSamplesToAlarm", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.minSampleCountToEvaluateDatapoint = software.amazon.jsii.Kernel.get(this, "minSampleCountToEvaluateDatapoint", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.overrideAnnotationColor = software.amazon.jsii.Kernel.get(this, "overrideAnnotationColor", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.overrideAnnotationLabel = software.amazon.jsii.Kernel.get(this, "overrideAnnotationLabel", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.overrideAnnotationVisibility = software.amazon.jsii.Kernel.get(this, "overrideAnnotationVisibility", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.period = software.amazon.jsii.Kernel.get(this, "period", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class));
this.runbookLink = software.amazon.jsii.Kernel.get(this, "runbookLink", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.treatMissingDataOverride = software.amazon.jsii.Kernel.get(this, "treatMissingDataOverride", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.cloudwatch.TreatMissingData.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.alarmWhenAboveTheBand = java.util.Objects.requireNonNull(builder.alarmWhenAboveTheBand, "alarmWhenAboveTheBand is required");
this.alarmWhenBelowTheBand = java.util.Objects.requireNonNull(builder.alarmWhenBelowTheBand, "alarmWhenBelowTheBand is required");
this.standardDeviationForAlarm = java.util.Objects.requireNonNull(builder.standardDeviationForAlarm, "standardDeviationForAlarm is required");
this.additionalDescription = builder.additionalDescription;
this.actionOverride = builder.actionOverride;
this.actionsEnabled = builder.actionsEnabled;
this.alarmDescriptionOverride = builder.alarmDescriptionOverride;
this.alarmNameOverride = builder.alarmNameOverride;
this.comparisonOperatorOverride = builder.comparisonOperatorOverride;
this.customParams = (java.util.Map)builder.customParams;
this.customTags = builder.customTags;
this.datapointsToAlarm = builder.datapointsToAlarm;
this.dedupeStringOverride = builder.dedupeStringOverride;
this.documentationLink = builder.documentationLink;
this.evaluateLowSampleCountPercentile = builder.evaluateLowSampleCountPercentile;
this.evaluationPeriods = builder.evaluationPeriods;
this.fillAlarmRange = builder.fillAlarmRange;
this.metricAdjuster = builder.metricAdjuster;
this.minMetricSamplesToAlarm = builder.minMetricSamplesToAlarm;
this.minSampleCountToEvaluateDatapoint = builder.minSampleCountToEvaluateDatapoint;
this.overrideAnnotationColor = builder.overrideAnnotationColor;
this.overrideAnnotationLabel = builder.overrideAnnotationLabel;
this.overrideAnnotationVisibility = builder.overrideAnnotationVisibility;
this.period = builder.period;
this.runbookLink = builder.runbookLink;
this.treatMissingDataOverride = builder.treatMissingDataOverride;
}
@Override
public final java.lang.Boolean getAlarmWhenAboveTheBand() {
return this.alarmWhenAboveTheBand;
}
@Override
public final java.lang.Boolean getAlarmWhenBelowTheBand() {
return this.alarmWhenBelowTheBand;
}
@Override
public final java.lang.Number getStandardDeviationForAlarm() {
return this.standardDeviationForAlarm;
}
@Override
public final java.lang.String getAdditionalDescription() {
return this.additionalDescription;
}
@Override
public final io.github.cdklabs.cdkmonitoringconstructs.IAlarmActionStrategy getActionOverride() {
return this.actionOverride;
}
@Override
public final java.lang.Boolean getActionsEnabled() {
return this.actionsEnabled;
}
@Override
public final java.lang.String getAlarmDescriptionOverride() {
return this.alarmDescriptionOverride;
}
@Override
public final java.lang.String getAlarmNameOverride() {
return this.alarmNameOverride;
}
@Override
public final software.amazon.awscdk.services.cloudwatch.ComparisonOperator getComparisonOperatorOverride() {
return this.comparisonOperatorOverride;
}
@Override
public final java.util.Map getCustomParams() {
return this.customParams;
}
@Override
public final java.util.List getCustomTags() {
return this.customTags;
}
@Override
public final java.lang.Number getDatapointsToAlarm() {
return this.datapointsToAlarm;
}
@Override
public final java.lang.String getDedupeStringOverride() {
return this.dedupeStringOverride;
}
@Override
public final java.lang.String getDocumentationLink() {
return this.documentationLink;
}
@Override
public final java.lang.Boolean getEvaluateLowSampleCountPercentile() {
return this.evaluateLowSampleCountPercentile;
}
@Override
public final java.lang.Number getEvaluationPeriods() {
return this.evaluationPeriods;
}
@Override
public final java.lang.Boolean getFillAlarmRange() {
return this.fillAlarmRange;
}
@Override
public final io.github.cdklabs.cdkmonitoringconstructs.IMetricAdjuster getMetricAdjuster() {
return this.metricAdjuster;
}
@Override
public final java.lang.Number getMinMetricSamplesToAlarm() {
return this.minMetricSamplesToAlarm;
}
@Override
public final java.lang.Number getMinSampleCountToEvaluateDatapoint() {
return this.minSampleCountToEvaluateDatapoint;
}
@Override
public final java.lang.String getOverrideAnnotationColor() {
return this.overrideAnnotationColor;
}
@Override
public final java.lang.String getOverrideAnnotationLabel() {
return this.overrideAnnotationLabel;
}
@Override
public final java.lang.Boolean getOverrideAnnotationVisibility() {
return this.overrideAnnotationVisibility;
}
@Override
public final software.amazon.awscdk.Duration getPeriod() {
return this.period;
}
@Override
public final java.lang.String getRunbookLink() {
return this.runbookLink;
}
@Override
public final software.amazon.awscdk.services.cloudwatch.TreatMissingData getTreatMissingDataOverride() {
return this.treatMissingDataOverride;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("alarmWhenAboveTheBand", om.valueToTree(this.getAlarmWhenAboveTheBand()));
data.set("alarmWhenBelowTheBand", om.valueToTree(this.getAlarmWhenBelowTheBand()));
data.set("standardDeviationForAlarm", om.valueToTree(this.getStandardDeviationForAlarm()));
if (this.getAdditionalDescription() != null) {
data.set("additionalDescription", om.valueToTree(this.getAdditionalDescription()));
}
if (this.getActionOverride() != null) {
data.set("actionOverride", om.valueToTree(this.getActionOverride()));
}
if (this.getActionsEnabled() != null) {
data.set("actionsEnabled", om.valueToTree(this.getActionsEnabled()));
}
if (this.getAlarmDescriptionOverride() != null) {
data.set("alarmDescriptionOverride", om.valueToTree(this.getAlarmDescriptionOverride()));
}
if (this.getAlarmNameOverride() != null) {
data.set("alarmNameOverride", om.valueToTree(this.getAlarmNameOverride()));
}
if (this.getComparisonOperatorOverride() != null) {
data.set("comparisonOperatorOverride", om.valueToTree(this.getComparisonOperatorOverride()));
}
if (this.getCustomParams() != null) {
data.set("customParams", om.valueToTree(this.getCustomParams()));
}
if (this.getCustomTags() != null) {
data.set("customTags", om.valueToTree(this.getCustomTags()));
}
if (this.getDatapointsToAlarm() != null) {
data.set("datapointsToAlarm", om.valueToTree(this.getDatapointsToAlarm()));
}
if (this.getDedupeStringOverride() != null) {
data.set("dedupeStringOverride", om.valueToTree(this.getDedupeStringOverride()));
}
if (this.getDocumentationLink() != null) {
data.set("documentationLink", om.valueToTree(this.getDocumentationLink()));
}
if (this.getEvaluateLowSampleCountPercentile() != null) {
data.set("evaluateLowSampleCountPercentile", om.valueToTree(this.getEvaluateLowSampleCountPercentile()));
}
if (this.getEvaluationPeriods() != null) {
data.set("evaluationPeriods", om.valueToTree(this.getEvaluationPeriods()));
}
if (this.getFillAlarmRange() != null) {
data.set("fillAlarmRange", om.valueToTree(this.getFillAlarmRange()));
}
if (this.getMetricAdjuster() != null) {
data.set("metricAdjuster", om.valueToTree(this.getMetricAdjuster()));
}
if (this.getMinMetricSamplesToAlarm() != null) {
data.set("minMetricSamplesToAlarm", om.valueToTree(this.getMinMetricSamplesToAlarm()));
}
if (this.getMinSampleCountToEvaluateDatapoint() != null) {
data.set("minSampleCountToEvaluateDatapoint", om.valueToTree(this.getMinSampleCountToEvaluateDatapoint()));
}
if (this.getOverrideAnnotationColor() != null) {
data.set("overrideAnnotationColor", om.valueToTree(this.getOverrideAnnotationColor()));
}
if (this.getOverrideAnnotationLabel() != null) {
data.set("overrideAnnotationLabel", om.valueToTree(this.getOverrideAnnotationLabel()));
}
if (this.getOverrideAnnotationVisibility() != null) {
data.set("overrideAnnotationVisibility", om.valueToTree(this.getOverrideAnnotationVisibility()));
}
if (this.getPeriod() != null) {
data.set("period", om.valueToTree(this.getPeriod()));
}
if (this.getRunbookLink() != null) {
data.set("runbookLink", om.valueToTree(this.getRunbookLink()));
}
if (this.getTreatMissingDataOverride() != null) {
data.set("treatMissingDataOverride", om.valueToTree(this.getTreatMissingDataOverride()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk-monitoring-constructs.AnomalyDetectionThreshold"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AnomalyDetectionThreshold.Jsii$Proxy that = (AnomalyDetectionThreshold.Jsii$Proxy) o;
if (!alarmWhenAboveTheBand.equals(that.alarmWhenAboveTheBand)) return false;
if (!alarmWhenBelowTheBand.equals(that.alarmWhenBelowTheBand)) return false;
if (!standardDeviationForAlarm.equals(that.standardDeviationForAlarm)) return false;
if (this.additionalDescription != null ? !this.additionalDescription.equals(that.additionalDescription) : that.additionalDescription != null) return false;
if (this.actionOverride != null ? !this.actionOverride.equals(that.actionOverride) : that.actionOverride != null) return false;
if (this.actionsEnabled != null ? !this.actionsEnabled.equals(that.actionsEnabled) : that.actionsEnabled != null) return false;
if (this.alarmDescriptionOverride != null ? !this.alarmDescriptionOverride.equals(that.alarmDescriptionOverride) : that.alarmDescriptionOverride != null) return false;
if (this.alarmNameOverride != null ? !this.alarmNameOverride.equals(that.alarmNameOverride) : that.alarmNameOverride != null) return false;
if (this.comparisonOperatorOverride != null ? !this.comparisonOperatorOverride.equals(that.comparisonOperatorOverride) : that.comparisonOperatorOverride != null) return false;
if (this.customParams != null ? !this.customParams.equals(that.customParams) : that.customParams != null) return false;
if (this.customTags != null ? !this.customTags.equals(that.customTags) : that.customTags != null) return false;
if (this.datapointsToAlarm != null ? !this.datapointsToAlarm.equals(that.datapointsToAlarm) : that.datapointsToAlarm != null) return false;
if (this.dedupeStringOverride != null ? !this.dedupeStringOverride.equals(that.dedupeStringOverride) : that.dedupeStringOverride != null) return false;
if (this.documentationLink != null ? !this.documentationLink.equals(that.documentationLink) : that.documentationLink != null) return false;
if (this.evaluateLowSampleCountPercentile != null ? !this.evaluateLowSampleCountPercentile.equals(that.evaluateLowSampleCountPercentile) : that.evaluateLowSampleCountPercentile != null) return false;
if (this.evaluationPeriods != null ? !this.evaluationPeriods.equals(that.evaluationPeriods) : that.evaluationPeriods != null) return false;
if (this.fillAlarmRange != null ? !this.fillAlarmRange.equals(that.fillAlarmRange) : that.fillAlarmRange != null) return false;
if (this.metricAdjuster != null ? !this.metricAdjuster.equals(that.metricAdjuster) : that.metricAdjuster != null) return false;
if (this.minMetricSamplesToAlarm != null ? !this.minMetricSamplesToAlarm.equals(that.minMetricSamplesToAlarm) : that.minMetricSamplesToAlarm != null) return false;
if (this.minSampleCountToEvaluateDatapoint != null ? !this.minSampleCountToEvaluateDatapoint.equals(that.minSampleCountToEvaluateDatapoint) : that.minSampleCountToEvaluateDatapoint != null) return false;
if (this.overrideAnnotationColor != null ? !this.overrideAnnotationColor.equals(that.overrideAnnotationColor) : that.overrideAnnotationColor != null) return false;
if (this.overrideAnnotationLabel != null ? !this.overrideAnnotationLabel.equals(that.overrideAnnotationLabel) : that.overrideAnnotationLabel != null) return false;
if (this.overrideAnnotationVisibility != null ? !this.overrideAnnotationVisibility.equals(that.overrideAnnotationVisibility) : that.overrideAnnotationVisibility != null) return false;
if (this.period != null ? !this.period.equals(that.period) : that.period != null) return false;
if (this.runbookLink != null ? !this.runbookLink.equals(that.runbookLink) : that.runbookLink != null) return false;
return this.treatMissingDataOverride != null ? this.treatMissingDataOverride.equals(that.treatMissingDataOverride) : that.treatMissingDataOverride == null;
}
@Override
public final int hashCode() {
int result = this.alarmWhenAboveTheBand.hashCode();
result = 31 * result + (this.alarmWhenBelowTheBand.hashCode());
result = 31 * result + (this.standardDeviationForAlarm.hashCode());
result = 31 * result + (this.additionalDescription != null ? this.additionalDescription.hashCode() : 0);
result = 31 * result + (this.actionOverride != null ? this.actionOverride.hashCode() : 0);
result = 31 * result + (this.actionsEnabled != null ? this.actionsEnabled.hashCode() : 0);
result = 31 * result + (this.alarmDescriptionOverride != null ? this.alarmDescriptionOverride.hashCode() : 0);
result = 31 * result + (this.alarmNameOverride != null ? this.alarmNameOverride.hashCode() : 0);
result = 31 * result + (this.comparisonOperatorOverride != null ? this.comparisonOperatorOverride.hashCode() : 0);
result = 31 * result + (this.customParams != null ? this.customParams.hashCode() : 0);
result = 31 * result + (this.customTags != null ? this.customTags.hashCode() : 0);
result = 31 * result + (this.datapointsToAlarm != null ? this.datapointsToAlarm.hashCode() : 0);
result = 31 * result + (this.dedupeStringOverride != null ? this.dedupeStringOverride.hashCode() : 0);
result = 31 * result + (this.documentationLink != null ? this.documentationLink.hashCode() : 0);
result = 31 * result + (this.evaluateLowSampleCountPercentile != null ? this.evaluateLowSampleCountPercentile.hashCode() : 0);
result = 31 * result + (this.evaluationPeriods != null ? this.evaluationPeriods.hashCode() : 0);
result = 31 * result + (this.fillAlarmRange != null ? this.fillAlarmRange.hashCode() : 0);
result = 31 * result + (this.metricAdjuster != null ? this.metricAdjuster.hashCode() : 0);
result = 31 * result + (this.minMetricSamplesToAlarm != null ? this.minMetricSamplesToAlarm.hashCode() : 0);
result = 31 * result + (this.minSampleCountToEvaluateDatapoint != null ? this.minSampleCountToEvaluateDatapoint.hashCode() : 0);
result = 31 * result + (this.overrideAnnotationColor != null ? this.overrideAnnotationColor.hashCode() : 0);
result = 31 * result + (this.overrideAnnotationLabel != null ? this.overrideAnnotationLabel.hashCode() : 0);
result = 31 * result + (this.overrideAnnotationVisibility != null ? this.overrideAnnotationVisibility.hashCode() : 0);
result = 31 * result + (this.period != null ? this.period.hashCode() : 0);
result = 31 * result + (this.runbookLink != null ? this.runbookLink.hashCode() : 0);
result = 31 * result + (this.treatMissingDataOverride != null ? this.treatMissingDataOverride.hashCode() : 0);
return result;
}
}
}