/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace CostExplorer { namespace Model { /** *

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 Also:

AWS * API Reference

*/ class AnomalySubscription { public: AWS_COSTEXPLORER_API AnomalySubscription(); AWS_COSTEXPLORER_API AnomalySubscription(Aws::Utils::Json::JsonView jsonValue); AWS_COSTEXPLORER_API AnomalySubscription& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_COSTEXPLORER_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The AnomalySubscription Amazon Resource Name (ARN).

*/ inline const Aws::String& GetSubscriptionArn() const{ return m_subscriptionArn; } /** *

The AnomalySubscription Amazon Resource Name (ARN).

*/ inline bool SubscriptionArnHasBeenSet() const { return m_subscriptionArnHasBeenSet; } /** *

The AnomalySubscription Amazon Resource Name (ARN).

*/ inline void SetSubscriptionArn(const Aws::String& value) { m_subscriptionArnHasBeenSet = true; m_subscriptionArn = value; } /** *

The AnomalySubscription Amazon Resource Name (ARN).

*/ inline void SetSubscriptionArn(Aws::String&& value) { m_subscriptionArnHasBeenSet = true; m_subscriptionArn = std::move(value); } /** *

The AnomalySubscription Amazon Resource Name (ARN).

*/ inline void SetSubscriptionArn(const char* value) { m_subscriptionArnHasBeenSet = true; m_subscriptionArn.assign(value); } /** *

The AnomalySubscription Amazon Resource Name (ARN).

*/ inline AnomalySubscription& WithSubscriptionArn(const Aws::String& value) { SetSubscriptionArn(value); return *this;} /** *

The AnomalySubscription Amazon Resource Name (ARN).

*/ inline AnomalySubscription& WithSubscriptionArn(Aws::String&& value) { SetSubscriptionArn(std::move(value)); return *this;} /** *

The AnomalySubscription Amazon Resource Name (ARN).

*/ inline AnomalySubscription& WithSubscriptionArn(const char* value) { SetSubscriptionArn(value); return *this;} /** *

Your unique account identifier.

*/ inline const Aws::String& GetAccountId() const{ return m_accountId; } /** *

Your unique account identifier.

*/ inline bool AccountIdHasBeenSet() const { return m_accountIdHasBeenSet; } /** *

Your unique account identifier.

*/ inline void SetAccountId(const Aws::String& value) { m_accountIdHasBeenSet = true; m_accountId = value; } /** *

Your unique account identifier.

*/ inline void SetAccountId(Aws::String&& value) { m_accountIdHasBeenSet = true; m_accountId = std::move(value); } /** *

Your unique account identifier.

*/ inline void SetAccountId(const char* value) { m_accountIdHasBeenSet = true; m_accountId.assign(value); } /** *

Your unique account identifier.

*/ inline AnomalySubscription& WithAccountId(const Aws::String& value) { SetAccountId(value); return *this;} /** *

Your unique account identifier.

*/ inline AnomalySubscription& WithAccountId(Aws::String&& value) { SetAccountId(std::move(value)); return *this;} /** *

Your unique account identifier.

*/ inline AnomalySubscription& WithAccountId(const char* value) { SetAccountId(value); return *this;} /** *

A list of cost anomaly monitors.

*/ inline const Aws::Vector& GetMonitorArnList() const{ return m_monitorArnList; } /** *

A list of cost anomaly monitors.

*/ inline bool MonitorArnListHasBeenSet() const { return m_monitorArnListHasBeenSet; } /** *

A list of cost anomaly monitors.

*/ inline void SetMonitorArnList(const Aws::Vector& value) { m_monitorArnListHasBeenSet = true; m_monitorArnList = value; } /** *

A list of cost anomaly monitors.

*/ inline void SetMonitorArnList(Aws::Vector&& value) { m_monitorArnListHasBeenSet = true; m_monitorArnList = std::move(value); } /** *

A list of cost anomaly monitors.

*/ inline AnomalySubscription& WithMonitorArnList(const Aws::Vector& value) { SetMonitorArnList(value); return *this;} /** *

A list of cost anomaly monitors.

*/ inline AnomalySubscription& WithMonitorArnList(Aws::Vector&& value) { SetMonitorArnList(std::move(value)); return *this;} /** *

A list of cost anomaly monitors.

*/ inline AnomalySubscription& AddMonitorArnList(const Aws::String& value) { m_monitorArnListHasBeenSet = true; m_monitorArnList.push_back(value); return *this; } /** *

A list of cost anomaly monitors.

*/ inline AnomalySubscription& AddMonitorArnList(Aws::String&& value) { m_monitorArnListHasBeenSet = true; m_monitorArnList.push_back(std::move(value)); return *this; } /** *

A list of cost anomaly monitors.

*/ inline AnomalySubscription& AddMonitorArnList(const char* value) { m_monitorArnListHasBeenSet = true; m_monitorArnList.push_back(value); return *this; } /** *

A list of subscribers to notify.

*/ inline const Aws::Vector& GetSubscribers() const{ return m_subscribers; } /** *

A list of subscribers to notify.

*/ inline bool SubscribersHasBeenSet() const { return m_subscribersHasBeenSet; } /** *

A list of subscribers to notify.

*/ inline void SetSubscribers(const Aws::Vector& value) { m_subscribersHasBeenSet = true; m_subscribers = value; } /** *

A list of subscribers to notify.

*/ inline void SetSubscribers(Aws::Vector&& value) { m_subscribersHasBeenSet = true; m_subscribers = std::move(value); } /** *

A list of subscribers to notify.

*/ inline AnomalySubscription& WithSubscribers(const Aws::Vector& value) { SetSubscribers(value); return *this;} /** *

A list of subscribers to notify.

*/ inline AnomalySubscription& WithSubscribers(Aws::Vector&& value) { SetSubscribers(std::move(value)); return *this;} /** *

A list of subscribers to notify.

*/ inline AnomalySubscription& AddSubscribers(const Subscriber& value) { m_subscribersHasBeenSet = true; m_subscribers.push_back(value); return *this; } /** *

A list of subscribers to notify.

*/ inline AnomalySubscription& AddSubscribers(Subscriber&& value) { m_subscribersHasBeenSet = true; m_subscribers.push_back(std::move(value)); 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.

*/ inline const AnomalySubscriptionFrequency& GetFrequency() const{ return m_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.

*/ inline bool FrequencyHasBeenSet() const { return m_frequencyHasBeenSet; } /** *

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.

*/ inline void SetFrequency(const AnomalySubscriptionFrequency& value) { m_frequencyHasBeenSet = true; m_frequency = value; } /** *

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.

*/ inline void SetFrequency(AnomalySubscriptionFrequency&& value) { m_frequencyHasBeenSet = true; m_frequency = std::move(value); } /** *

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.

*/ inline AnomalySubscription& WithFrequency(const AnomalySubscriptionFrequency& value) { SetFrequency(value); 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.

*/ inline AnomalySubscription& WithFrequency(AnomalySubscriptionFrequency&& value) { SetFrequency(std::move(value)); return *this;} /** *

The name for the subscription.

*/ inline const Aws::String& GetSubscriptionName() const{ return m_subscriptionName; } /** *

The name for the subscription.

*/ inline bool SubscriptionNameHasBeenSet() const { return m_subscriptionNameHasBeenSet; } /** *

The name for the subscription.

*/ inline void SetSubscriptionName(const Aws::String& value) { m_subscriptionNameHasBeenSet = true; m_subscriptionName = value; } /** *

The name for the subscription.

*/ inline void SetSubscriptionName(Aws::String&& value) { m_subscriptionNameHasBeenSet = true; m_subscriptionName = std::move(value); } /** *

The name for the subscription.

*/ inline void SetSubscriptionName(const char* value) { m_subscriptionNameHasBeenSet = true; m_subscriptionName.assign(value); } /** *

The name for the subscription.

*/ inline AnomalySubscription& WithSubscriptionName(const Aws::String& value) { SetSubscriptionName(value); return *this;} /** *

The name for the subscription.

*/ inline AnomalySubscription& WithSubscriptionName(Aws::String&& value) { SetSubscriptionName(std::move(value)); return *this;} /** *

The name for the subscription.

*/ inline AnomalySubscription& WithSubscriptionName(const char* value) { SetSubscriptionName(value); 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" ] } } ] }

*/ inline const Expression& GetThresholdExpression() const{ return m_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" ] } } ] }

*/ inline bool ThresholdExpressionHasBeenSet() const { return m_thresholdExpressionHasBeenSet; } /** *

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" ] } } ] }

*/ inline void SetThresholdExpression(const Expression& value) { m_thresholdExpressionHasBeenSet = true; m_thresholdExpression = value; } /** *

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" ] } } ] }

*/ inline void SetThresholdExpression(Expression&& value) { m_thresholdExpressionHasBeenSet = true; m_thresholdExpression = std::move(value); } /** *

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" ] } } ] }

*/ inline AnomalySubscription& WithThresholdExpression(const Expression& value) { SetThresholdExpression(value); 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" ] } } ] }

*/ inline AnomalySubscription& WithThresholdExpression(Expression&& value) { SetThresholdExpression(std::move(value)); return *this;} private: Aws::String m_subscriptionArn; bool m_subscriptionArnHasBeenSet = false; Aws::String m_accountId; bool m_accountIdHasBeenSet = false; Aws::Vector m_monitorArnList; bool m_monitorArnListHasBeenSet = false; Aws::Vector m_subscribers; bool m_subscribersHasBeenSet = false; AnomalySubscriptionFrequency m_frequency; bool m_frequencyHasBeenSet = false; Aws::String m_subscriptionName; bool m_subscriptionNameHasBeenSet = false; Expression m_thresholdExpression; bool m_thresholdExpressionHasBeenSet = false; }; } // namespace Model } // namespace CostExplorer } // namespace Aws