// 
// Copyright (c) Microsoft and contributors.  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.
// You may obtain a copy of the License at
//   http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License 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.
// 

// Warning: This code was generated by a tool.
// 
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.

using System;
using System.Linq;
using Microsoft.Azure.Management.Insights.Models;

namespace Microsoft.Azure.Management.Insights.Models
{
    /// <summary>
    /// The trigger that results in a scaling action.
    /// </summary>
    public partial class MetricTrigger
    {
        private string _metricName;
        
        /// <summary>
        /// Optional. Gets or sets the name of the metric that defines what the
        /// rule monitors.
        /// </summary>
        public string MetricName
        {
            get { return this._metricName; }
            set { this._metricName = value; }
        }
        
        private string _metricNamespace;
        
        /// <summary>
        /// Optional. Gets or sets the metric namespace.Only should be present
        /// for availability level metrics, where the value must be
        /// WindowsAzure.Availability.
        /// </summary>
        public string MetricNamespace
        {
            get { return this._metricNamespace; }
            set { this._metricNamespace = value; }
        }
        
        private string _metricResourceUri;
        
        /// <summary>
        /// Optional. Gets or sets the resource identifier of the resource the
        /// rule monitors.
        /// </summary>
        public string MetricResourceUri
        {
            get { return this._metricResourceUri; }
            set { this._metricResourceUri = value; }
        }
        
        private ComparisonOperationType _operator;
        
        /// <summary>
        /// Optional. Gets or sets the operator that is used to compare the
        /// metric data and the threshold.
        /// </summary>
        public ComparisonOperationType Operator
        {
            get { return this._operator; }
            set { this._operator = value; }
        }
        
        private MetricStatisticType _statistic;
        
        /// <summary>
        /// Optional. Gets or sets the metric statistic type.How the metrics
        /// from multiple instances are combined.
        /// </summary>
        public MetricStatisticType Statistic
        {
            get { return this._statistic; }
            set { this._statistic = value; }
        }
        
        private double _threshold;
        
        /// <summary>
        /// Optional. Gets or sets the threshold of the metric that triggers
        /// the scale action.
        /// </summary>
        public double Threshold
        {
            get { return this._threshold; }
            set { this._threshold = value; }
        }
        
        private TimeAggregationType _timeAggregation;
        
        /// <summary>
        /// Optional. Gets or sets time aggregation type.How the data that is
        /// collected should be combined over time. The default value is
        /// Average.
        /// </summary>
        public TimeAggregationType TimeAggregation
        {
            get { return this._timeAggregation; }
            set { this._timeAggregation = value; }
        }
        
        private TimeSpan _timeGrain;
        
        /// <summary>
        /// Optional. Gets or sets the granularity of metrics the rule
        /// monitors. Must be one of the predefined values returned from
        /// metric definitions for the metric. Must be between 12 hours and 1
        /// minute.
        /// </summary>
        public TimeSpan TimeGrain
        {
            get { return this._timeGrain; }
            set { this._timeGrain = value; }
        }
        
        private TimeSpan _timeWindow;
        
        /// <summary>
        /// Optional. Gets or sets the range of time in which instance data is
        /// collected. This value must be greater than the delay in metric
        /// collection, which can vary from resource-to-resource. Must be
        /// between 12 hours and 5 minutes.
        /// </summary>
        public TimeSpan TimeWindow
        {
            get { return this._timeWindow; }
            set { this._timeWindow = value; }
        }
        
        /// <summary>
        /// Initializes a new instance of the MetricTrigger class.
        /// </summary>
        public MetricTrigger()
        {
        }
    }
}
