/*
 * 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 monitoring-2010-08-01.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.CloudWatch.Model
{
    /// 
    /// This structure defines the metric to be returned, along with the statistics, period,
    /// and units.
    /// 
    public partial class MetricStat
    {
        private Metric _metric;
        private int? _period;
        private string _stat;
        private StandardUnit _unit;
        /// 
        /// Gets and sets the property Metric. 
        /// 
        /// The metric to return, including the metric name, namespace, and dimensions.
        /// 
        /// 
        [AWSProperty(Required=true)]
        public Metric Metric
        {
            get { return this._metric; }
            set { this._metric = value; }
        }
        // Check to see if Metric property is set
        internal bool IsSetMetric()
        {
            return this._metric != null;
        }
        /// 
        /// Gets and sets the property Period. 
        /// 
        /// The granularity, in seconds, of the returned data points. For metrics with regular
        /// resolution, a period can be as short as one minute (60 seconds) and must be a multiple
        /// of 60. For high-resolution metrics that are collected at intervals of less than one
        /// minute, the period can be 1, 5, 10, 30, 60, or any multiple of 60. High-resolution
        /// metrics are those metrics stored by a PutMetricData call that includes
        /// a StorageResolution of 1 second.
        /// 
        ///  
        /// 
        /// If the StartTime parameter specifies a time stamp that is greater than
        /// 3 hours ago, you must specify the period as follows or no data points in that time
        /// range is returned:
        /// 
        ///   -  
        /// 
        /// Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds (1 minute).
        /// 
        ///  
  -  
        /// 
        /// Start time between 15 and 63 days ago - Use a multiple of 300 seconds (5 minutes).
        /// 
        ///  
  -  
        /// 
        /// Start time greater than 63 days ago - Use a multiple of 3600 seconds (1 hour).
        /// 
        ///  
  
        /// 
        [AWSProperty(Required=true, Min=1)]
        public int Period
        {
            get { return this._period.GetValueOrDefault(); }
            set { this._period = value; }
        }
        // Check to see if Period property is set
        internal bool IsSetPeriod()
        {
            return this._period.HasValue; 
        }
        /// 
        /// Gets and sets the property Stat. 
        /// 
        /// The statistic to return. It can include any CloudWatch statistic or extended statistic.
        /// 
        /// 
        [AWSProperty(Required=true)]
        public string Stat
        {
            get { return this._stat; }
            set { this._stat = value; }
        }
        // Check to see if Stat property is set
        internal bool IsSetStat()
        {
            return this._stat != null;
        }
        /// 
        /// Gets and sets the property Unit. 
        /// 
        /// When you are using a Put operation, this defines what unit you want to
        /// use when storing the metric.
        /// 
        ///  
        /// 
        /// In a Get operation, if you omit Unit then all data that
        /// was collected with any unit is returned, along with the corresponding units that were
        /// specified when the data was reported to CloudWatch. If you specify a unit, the operation
        /// returns only data that was collected with that unit specified. If you specify a unit
        /// that does not match the data collected, the results of the operation are null. CloudWatch
        /// does not perform unit conversions.
        /// 
        /// 
        public StandardUnit Unit
        {
            get { return this._unit; }
            set { this._unit = value; }
        }
        // Check to see if Unit property is set
        internal bool IsSetUnit()
        {
            return this._unit != null;
        }
    }
}