/*
* Copyright 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.
*/
/*
* Do not modify this file. This file is generated from the ce-2017-10-25.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.CostExplorer.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.
///
///
public partial class AnomalySubscription
{
private string _accountId;
private AnomalySubscriptionFrequency _frequency;
private List _monitorArnList = new List();
private List _subscribers = new List();
private string _subscriptionArn;
private string _subscriptionName;
private double? _threshold;
private Expression _thresholdExpression;
///
/// Gets and sets the property AccountId.
///
/// Your unique account identifier.
///
///
[AWSProperty(Min=0, Max=1024)]
public string AccountId
{
get { return this._accountId; }
set { this._accountId = value; }
}
// Check to see if AccountId property is set
internal bool IsSetAccountId()
{
return this._accountId != null;
}
///
/// Gets and sets the property 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.
///
///
[AWSProperty(Required=true)]
public AnomalySubscriptionFrequency Frequency
{
get { return this._frequency; }
set { this._frequency = value; }
}
// Check to see if Frequency property is set
internal bool IsSetFrequency()
{
return this._frequency != null;
}
///
/// Gets and sets the property MonitorArnList.
///
/// A list of cost anomaly monitors.
///
///
[AWSProperty(Required=true)]
public List MonitorArnList
{
get { return this._monitorArnList; }
set { this._monitorArnList = value; }
}
// Check to see if MonitorArnList property is set
internal bool IsSetMonitorArnList()
{
return this._monitorArnList != null && this._monitorArnList.Count > 0;
}
///
/// Gets and sets the property Subscribers.
///
/// A list of subscribers to notify.
///
///
[AWSProperty(Required=true)]
public List Subscribers
{
get { return this._subscribers; }
set { this._subscribers = value; }
}
// Check to see if Subscribers property is set
internal bool IsSetSubscribers()
{
return this._subscribers != null && this._subscribers.Count > 0;
}
///
/// Gets and sets the property SubscriptionArn.
///
/// The AnomalySubscription
Amazon Resource Name (ARN).
///
///
[AWSProperty(Min=0, Max=1024)]
public string SubscriptionArn
{
get { return this._subscriptionArn; }
set { this._subscriptionArn = value; }
}
// Check to see if SubscriptionArn property is set
internal bool IsSetSubscriptionArn()
{
return this._subscriptionArn != null;
}
///
/// Gets and sets the property SubscriptionName.
///
/// The name for the subscription.
///
///
[AWSProperty(Required=true, Min=0, Max=1024)]
public string SubscriptionName
{
get { return this._subscriptionName; }
set { this._subscriptionName = value; }
}
// Check to see if SubscriptionName property is set
internal bool IsSetSubscriptionName()
{
return this._subscriptionName != null;
}
///
/// Gets and sets the property 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.
///
///
[Obsolete("Threshold has been deprecated in favor of ThresholdExpression")]
[AWSProperty(Min=0)]
public double Threshold
{
get { return this._threshold.GetValueOrDefault(); }
set { this._threshold = value; }
}
// Check to see if Threshold property is set
internal bool IsSetThreshold()
{
return this._threshold.HasValue;
}
///
/// Gets and sets the property 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 Expression ThresholdExpression
{
get { return this._thresholdExpression; }
set { this._thresholdExpression = value; }
}
// Check to see if ThresholdExpression property is set
internal bool IsSetThresholdExpression()
{
return this._thresholdExpression != null;
}
}
}