
com.amazonaws.services.costexplorer.model.AnomalySubscription Maven / Gradle / Ivy
Show all versions of aws-java-sdk-costexplorer Show documentation
/*
* Copyright 2020-2025 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.costexplorer.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* An AnomalySubscription
resource (also referred to as an alert subscription) sends notifications about
* specific anomalies that meet an alerting criteria defined by you.
*
*
* You can specify the frequency of the alerts and the subscribers to notify.
*
*
* Anomaly subscriptions can be associated with one or more
* AnomalyMonitor
resources, and they only send notifications about anomalies detected by those
* associated monitors. You can also configure a threshold to further control which anomalies are included in the
* notifications.
*
*
* Anomalies that don’t exceed the chosen threshold and therefore don’t trigger notifications from an anomaly
* subscription will still be available on the console and from the
* GetAnomalies
API.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AnomalySubscription implements Serializable, Cloneable, StructuredPojo {
/**
*
* The AnomalySubscription
Amazon Resource Name (ARN).
*
*/
private String subscriptionArn;
/**
*
* Your unique account identifier.
*
*/
private String accountId;
/**
*
* A list of cost anomaly monitors.
*
*/
private java.util.List monitorArnList;
/**
*
* A list of subscribers to notify.
*
*/
private java.util.List subscribers;
/**
*
* (deprecated)
*
*
* An absolute dollar value that must be exceeded by the anomaly's total impact (see Impact for more
* details) for an anomaly notification to be generated.
*
*
* This field has been deprecated. To specify a threshold, use ThresholdExpression. Continued use of Threshold will
* be treated as shorthand syntax for a ThresholdExpression.
*
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
*
*/
@Deprecated
private Double threshold;
/**
*
* The frequency that anomaly notifications are sent. Notifications are sent either over email (for DAILY and WEEKLY
* frequencies) or SNS (for IMMEDIATE frequency). For more information, see Creating an Amazon SNS topic for
* anomaly notifications.
*
*/
private String frequency;
/**
*
* The name for the subscription.
*
*/
private String subscriptionName;
/**
*
* An Expression
* object used to specify the anomalies that you want to generate alerts for. This supports dimensions and nested
* expressions. The supported dimensions are ANOMALY_TOTAL_IMPACT_ABSOLUTE
and
* ANOMALY_TOTAL_IMPACT_PERCENTAGE
, corresponding to an anomaly’s TotalImpact and
* TotalImpactPercentage, respectively (see Impact for more
* details). The supported nested expression types are AND
and OR
. The match option
* GREATER_THAN_OR_EQUAL
is required. Values must be numbers between 0 and 10,000,000,000 in string
* format.
*
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
*
*
* The following are examples of valid ThresholdExpressions:
*
*
* -
*
* Absolute threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* Percentage threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* AND
two thresholds together:
* { "And": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
* -
*
* OR
two thresholds together:
* { "Or": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
*
*/
private Expression thresholdExpression;
/**
*
* The AnomalySubscription
Amazon Resource Name (ARN).
*
*
* @param subscriptionArn
* The AnomalySubscription
Amazon Resource Name (ARN).
*/
public void setSubscriptionArn(String subscriptionArn) {
this.subscriptionArn = subscriptionArn;
}
/**
*
* The AnomalySubscription
Amazon Resource Name (ARN).
*
*
* @return The AnomalySubscription
Amazon Resource Name (ARN).
*/
public String getSubscriptionArn() {
return this.subscriptionArn;
}
/**
*
* The AnomalySubscription
Amazon Resource Name (ARN).
*
*
* @param subscriptionArn
* The AnomalySubscription
Amazon Resource Name (ARN).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnomalySubscription withSubscriptionArn(String subscriptionArn) {
setSubscriptionArn(subscriptionArn);
return this;
}
/**
*
* Your unique account identifier.
*
*
* @param accountId
* Your unique account identifier.
*/
public void setAccountId(String accountId) {
this.accountId = accountId;
}
/**
*
* Your unique account identifier.
*
*
* @return Your unique account identifier.
*/
public String getAccountId() {
return this.accountId;
}
/**
*
* Your unique account identifier.
*
*
* @param accountId
* Your unique account identifier.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnomalySubscription withAccountId(String accountId) {
setAccountId(accountId);
return this;
}
/**
*
* A list of cost anomaly monitors.
*
*
* @return A list of cost anomaly monitors.
*/
public java.util.List getMonitorArnList() {
return monitorArnList;
}
/**
*
* A list of cost anomaly monitors.
*
*
* @param monitorArnList
* A list of cost anomaly monitors.
*/
public void setMonitorArnList(java.util.Collection monitorArnList) {
if (monitorArnList == null) {
this.monitorArnList = null;
return;
}
this.monitorArnList = new java.util.ArrayList(monitorArnList);
}
/**
*
* A list of cost anomaly monitors.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setMonitorArnList(java.util.Collection)} or {@link #withMonitorArnList(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param monitorArnList
* A list of cost anomaly monitors.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnomalySubscription withMonitorArnList(String... monitorArnList) {
if (this.monitorArnList == null) {
setMonitorArnList(new java.util.ArrayList(monitorArnList.length));
}
for (String ele : monitorArnList) {
this.monitorArnList.add(ele);
}
return this;
}
/**
*
* A list of cost anomaly monitors.
*
*
* @param monitorArnList
* A list of cost anomaly monitors.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnomalySubscription withMonitorArnList(java.util.Collection monitorArnList) {
setMonitorArnList(monitorArnList);
return this;
}
/**
*
* A list of subscribers to notify.
*
*
* @return A list of subscribers to notify.
*/
public java.util.List getSubscribers() {
return subscribers;
}
/**
*
* A list of subscribers to notify.
*
*
* @param subscribers
* A list of subscribers to notify.
*/
public void setSubscribers(java.util.Collection subscribers) {
if (subscribers == null) {
this.subscribers = null;
return;
}
this.subscribers = new java.util.ArrayList(subscribers);
}
/**
*
* A list of subscribers to notify.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSubscribers(java.util.Collection)} or {@link #withSubscribers(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param subscribers
* A list of subscribers to notify.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnomalySubscription withSubscribers(Subscriber... subscribers) {
if (this.subscribers == null) {
setSubscribers(new java.util.ArrayList(subscribers.length));
}
for (Subscriber ele : subscribers) {
this.subscribers.add(ele);
}
return this;
}
/**
*
* A list of subscribers to notify.
*
*
* @param subscribers
* A list of subscribers to notify.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnomalySubscription withSubscribers(java.util.Collection subscribers) {
setSubscribers(subscribers);
return this;
}
/**
*
* (deprecated)
*
*
* An absolute dollar value that must be exceeded by the anomaly's total impact (see Impact for more
* details) for an anomaly notification to be generated.
*
*
* This field has been deprecated. To specify a threshold, use ThresholdExpression. Continued use of Threshold will
* be treated as shorthand syntax for a ThresholdExpression.
*
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
*
*
* @param threshold
* (deprecated)
*
* An absolute dollar value that must be exceeded by the anomaly's total impact (see Impact for
* more details) for an anomaly notification to be generated.
*
*
* This field has been deprecated. To specify a threshold, use ThresholdExpression. Continued use of
* Threshold will be treated as shorthand syntax for a ThresholdExpression.
*
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
*/
@Deprecated
public void setThreshold(Double threshold) {
this.threshold = threshold;
}
/**
*
* (deprecated)
*
*
* An absolute dollar value that must be exceeded by the anomaly's total impact (see Impact for more
* details) for an anomaly notification to be generated.
*
*
* This field has been deprecated. To specify a threshold, use ThresholdExpression. Continued use of Threshold will
* be treated as shorthand syntax for a ThresholdExpression.
*
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
*
*
* @return (deprecated)
*
* An absolute dollar value that must be exceeded by the anomaly's total impact (see Impact for
* more details) for an anomaly notification to be generated.
*
*
* This field has been deprecated. To specify a threshold, use ThresholdExpression. Continued use of
* Threshold will be treated as shorthand syntax for a ThresholdExpression.
*
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
*/
@Deprecated
public Double getThreshold() {
return this.threshold;
}
/**
*
* (deprecated)
*
*
* An absolute dollar value that must be exceeded by the anomaly's total impact (see Impact for more
* details) for an anomaly notification to be generated.
*
*
* This field has been deprecated. To specify a threshold, use ThresholdExpression. Continued use of Threshold will
* be treated as shorthand syntax for a ThresholdExpression.
*
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
*
*
* @param threshold
* (deprecated)
*
* An absolute dollar value that must be exceeded by the anomaly's total impact (see Impact for
* more details) for an anomaly notification to be generated.
*
*
* This field has been deprecated. To specify a threshold, use ThresholdExpression. Continued use of
* Threshold will be treated as shorthand syntax for a ThresholdExpression.
*
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
* @return Returns a reference to this object so that method calls can be chained together.
*/
@Deprecated
public AnomalySubscription withThreshold(Double threshold) {
setThreshold(threshold);
return this;
}
/**
*
* The frequency that anomaly notifications are sent. Notifications are sent either over email (for DAILY and WEEKLY
* frequencies) or SNS (for IMMEDIATE frequency). For more information, see Creating an Amazon SNS topic for
* anomaly notifications.
*
*
* @param frequency
* The frequency that anomaly notifications are sent. Notifications are sent either over email (for DAILY and
* WEEKLY frequencies) or SNS (for IMMEDIATE frequency). For more information, see Creating an Amazon SNS
* topic for anomaly notifications.
* @see AnomalySubscriptionFrequency
*/
public void setFrequency(String frequency) {
this.frequency = frequency;
}
/**
*
* The frequency that anomaly notifications are sent. Notifications are sent either over email (for DAILY and WEEKLY
* frequencies) or SNS (for IMMEDIATE frequency). For more information, see Creating an Amazon SNS topic for
* anomaly notifications.
*
*
* @return The frequency that anomaly notifications are sent. Notifications are sent either over email (for DAILY
* and WEEKLY frequencies) or SNS (for IMMEDIATE frequency). For more information, see Creating an Amazon SNS
* topic for anomaly notifications.
* @see AnomalySubscriptionFrequency
*/
public String getFrequency() {
return this.frequency;
}
/**
*
* The frequency that anomaly notifications are sent. Notifications are sent either over email (for DAILY and WEEKLY
* frequencies) or SNS (for IMMEDIATE frequency). For more information, see Creating an Amazon SNS topic for
* anomaly notifications.
*
*
* @param frequency
* The frequency that anomaly notifications are sent. Notifications are sent either over email (for DAILY and
* WEEKLY frequencies) or SNS (for IMMEDIATE frequency). For more information, see Creating an Amazon SNS
* topic for anomaly notifications.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AnomalySubscriptionFrequency
*/
public AnomalySubscription withFrequency(String frequency) {
setFrequency(frequency);
return this;
}
/**
*
* The frequency that anomaly notifications are sent. Notifications are sent either over email (for DAILY and WEEKLY
* frequencies) or SNS (for IMMEDIATE frequency). For more information, see Creating an Amazon SNS topic for
* anomaly notifications.
*
*
* @param frequency
* The frequency that anomaly notifications are sent. Notifications are sent either over email (for DAILY and
* WEEKLY frequencies) or SNS (for IMMEDIATE frequency). For more information, see Creating an Amazon SNS
* topic for anomaly notifications.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AnomalySubscriptionFrequency
*/
public AnomalySubscription withFrequency(AnomalySubscriptionFrequency frequency) {
this.frequency = frequency.toString();
return this;
}
/**
*
* The name for the subscription.
*
*
* @param subscriptionName
* The name for the subscription.
*/
public void setSubscriptionName(String subscriptionName) {
this.subscriptionName = subscriptionName;
}
/**
*
* The name for the subscription.
*
*
* @return The name for the subscription.
*/
public String getSubscriptionName() {
return this.subscriptionName;
}
/**
*
* The name for the subscription.
*
*
* @param subscriptionName
* The name for the subscription.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnomalySubscription withSubscriptionName(String subscriptionName) {
setSubscriptionName(subscriptionName);
return this;
}
/**
*
* An Expression
* object used to specify the anomalies that you want to generate alerts for. This supports dimensions and nested
* expressions. The supported dimensions are ANOMALY_TOTAL_IMPACT_ABSOLUTE
and
* ANOMALY_TOTAL_IMPACT_PERCENTAGE
, corresponding to an anomaly’s TotalImpact and
* TotalImpactPercentage, respectively (see Impact for more
* details). The supported nested expression types are AND
and OR
. The match option
* GREATER_THAN_OR_EQUAL
is required. Values must be numbers between 0 and 10,000,000,000 in string
* format.
*
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
*
*
* The following are examples of valid ThresholdExpressions:
*
*
* -
*
* Absolute threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* Percentage threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* AND
two thresholds together:
* { "And": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
* -
*
* OR
two thresholds together:
* { "Or": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
*
*
* @param thresholdExpression
* An
* Expression object used to specify the anomalies that you want to generate alerts for. This supports
* dimensions and nested expressions. The supported dimensions are ANOMALY_TOTAL_IMPACT_ABSOLUTE
* and ANOMALY_TOTAL_IMPACT_PERCENTAGE
, corresponding to an anomaly’s TotalImpact and
* TotalImpactPercentage, respectively (see Impact for
* more details). The supported nested expression types are AND
and OR
. The match
* option GREATER_THAN_OR_EQUAL
is required. Values must be numbers between 0 and 10,000,000,000
* in string format.
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
*
*
* The following are examples of valid ThresholdExpressions:
*
*
* -
*
* Absolute threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* Percentage threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* AND
two thresholds together:
* { "And": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
* -
*
* OR
two thresholds together:
* { "Or": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
*/
public void setThresholdExpression(Expression thresholdExpression) {
this.thresholdExpression = thresholdExpression;
}
/**
*
* An Expression
* object used to specify the anomalies that you want to generate alerts for. This supports dimensions and nested
* expressions. The supported dimensions are ANOMALY_TOTAL_IMPACT_ABSOLUTE
and
* ANOMALY_TOTAL_IMPACT_PERCENTAGE
, corresponding to an anomaly’s TotalImpact and
* TotalImpactPercentage, respectively (see Impact for more
* details). The supported nested expression types are AND
and OR
. The match option
* GREATER_THAN_OR_EQUAL
is required. Values must be numbers between 0 and 10,000,000,000 in string
* format.
*
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
*
*
* The following are examples of valid ThresholdExpressions:
*
*
* -
*
* Absolute threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* Percentage threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* AND
two thresholds together:
* { "And": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
* -
*
* OR
two thresholds together:
* { "Or": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
*
*
* @return An Expression
* object used to specify the anomalies that you want to generate alerts for. This supports dimensions
* and nested expressions. The supported dimensions are ANOMALY_TOTAL_IMPACT_ABSOLUTE
and
* ANOMALY_TOTAL_IMPACT_PERCENTAGE
, corresponding to an anomaly’s TotalImpact and
* TotalImpactPercentage, respectively (see Impact for
* more details). The supported nested expression types are AND
and OR
. The match
* option GREATER_THAN_OR_EQUAL
is required. Values must be numbers between 0 and
* 10,000,000,000 in string format.
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
*
*
* The following are examples of valid ThresholdExpressions:
*
*
* -
*
* Absolute threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* Percentage threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* AND
two thresholds together:
* { "And": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
* -
*
* OR
two thresholds together:
* { "Or": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
*/
public Expression getThresholdExpression() {
return this.thresholdExpression;
}
/**
*
* An Expression
* object used to specify the anomalies that you want to generate alerts for. This supports dimensions and nested
* expressions. The supported dimensions are ANOMALY_TOTAL_IMPACT_ABSOLUTE
and
* ANOMALY_TOTAL_IMPACT_PERCENTAGE
, corresponding to an anomaly’s TotalImpact and
* TotalImpactPercentage, respectively (see Impact for more
* details). The supported nested expression types are AND
and OR
. The match option
* GREATER_THAN_OR_EQUAL
is required. Values must be numbers between 0 and 10,000,000,000 in string
* format.
*
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
*
*
* The following are examples of valid ThresholdExpressions:
*
*
* -
*
* Absolute threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* Percentage threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* AND
two thresholds together:
* { "And": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
* -
*
* OR
two thresholds together:
* { "Or": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
*
*
* @param thresholdExpression
* An
* Expression object used to specify the anomalies that you want to generate alerts for. This supports
* dimensions and nested expressions. The supported dimensions are ANOMALY_TOTAL_IMPACT_ABSOLUTE
* and ANOMALY_TOTAL_IMPACT_PERCENTAGE
, corresponding to an anomaly’s TotalImpact and
* TotalImpactPercentage, respectively (see Impact for
* more details). The supported nested expression types are AND
and OR
. The match
* option GREATER_THAN_OR_EQUAL
is required. Values must be numbers between 0 and 10,000,000,000
* in string format.
*
* One of Threshold or ThresholdExpression is required for this resource. You cannot specify both.
*
*
* The following are examples of valid ThresholdExpressions:
*
*
* -
*
* Absolute threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* Percentage threshold:
* { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }
*
*
* -
*
* AND
two thresholds together:
* { "And": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
* -
*
* OR
two thresholds together:
* { "Or": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AnomalySubscription withThresholdExpression(Expression thresholdExpression) {
setThresholdExpression(thresholdExpression);
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 (getSubscriptionArn() != null)
sb.append("SubscriptionArn: ").append(getSubscriptionArn()).append(",");
if (getAccountId() != null)
sb.append("AccountId: ").append(getAccountId()).append(",");
if (getMonitorArnList() != null)
sb.append("MonitorArnList: ").append(getMonitorArnList()).append(",");
if (getSubscribers() != null)
sb.append("Subscribers: ").append(getSubscribers()).append(",");
if (getThreshold() != null)
sb.append("Threshold: ").append(getThreshold()).append(",");
if (getFrequency() != null)
sb.append("Frequency: ").append(getFrequency()).append(",");
if (getSubscriptionName() != null)
sb.append("SubscriptionName: ").append(getSubscriptionName()).append(",");
if (getThresholdExpression() != null)
sb.append("ThresholdExpression: ").append(getThresholdExpression());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AnomalySubscription == false)
return false;
AnomalySubscription other = (AnomalySubscription) obj;
if (other.getSubscriptionArn() == null ^ this.getSubscriptionArn() == null)
return false;
if (other.getSubscriptionArn() != null && other.getSubscriptionArn().equals(this.getSubscriptionArn()) == false)
return false;
if (other.getAccountId() == null ^ this.getAccountId() == null)
return false;
if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false)
return false;
if (other.getMonitorArnList() == null ^ this.getMonitorArnList() == null)
return false;
if (other.getMonitorArnList() != null && other.getMonitorArnList().equals(this.getMonitorArnList()) == false)
return false;
if (other.getSubscribers() == null ^ this.getSubscribers() == null)
return false;
if (other.getSubscribers() != null && other.getSubscribers().equals(this.getSubscribers()) == 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.getFrequency() == null ^ this.getFrequency() == null)
return false;
if (other.getFrequency() != null && other.getFrequency().equals(this.getFrequency()) == false)
return false;
if (other.getSubscriptionName() == null ^ this.getSubscriptionName() == null)
return false;
if (other.getSubscriptionName() != null && other.getSubscriptionName().equals(this.getSubscriptionName()) == false)
return false;
if (other.getThresholdExpression() == null ^ this.getThresholdExpression() == null)
return false;
if (other.getThresholdExpression() != null && other.getThresholdExpression().equals(this.getThresholdExpression()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getSubscriptionArn() == null) ? 0 : getSubscriptionArn().hashCode());
hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
hashCode = prime * hashCode + ((getMonitorArnList() == null) ? 0 : getMonitorArnList().hashCode());
hashCode = prime * hashCode + ((getSubscribers() == null) ? 0 : getSubscribers().hashCode());
hashCode = prime * hashCode + ((getThreshold() == null) ? 0 : getThreshold().hashCode());
hashCode = prime * hashCode + ((getFrequency() == null) ? 0 : getFrequency().hashCode());
hashCode = prime * hashCode + ((getSubscriptionName() == null) ? 0 : getSubscriptionName().hashCode());
hashCode = prime * hashCode + ((getThresholdExpression() == null) ? 0 : getThresholdExpression().hashCode());
return hashCode;
}
@Override
public AnomalySubscription clone() {
try {
return (AnomalySubscription) 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.costexplorer.model.transform.AnomalySubscriptionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}