/* * 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 { /// /// Encapsulates the information sent to either create a metric or add new values to be /// aggregated into an existing metric. /// public partial class MetricDatum { private List _counts = new List(); private List _dimensions = new List(); private string _metricName; private StatisticSet _statisticValues; private int? _storageResolution; private DateTime? _timestampUtc; private StandardUnit _unit; private double? _value; private List _values = new List(); /// /// Gets and sets the property Counts. /// /// Array of numbers that is used along with the Values array. Each number /// in the Count array is the number of times the corresponding value in /// the Values array occurred during the period. /// /// /// /// If you omit the Counts array, the default of 1 is used as the value for /// each count. If you include a Counts array, it must include the same amount /// of values as the Values array. /// /// public List Counts { get { return this._counts; } set { this._counts = value; } } // Check to see if Counts property is set internal bool IsSetCounts() { return this._counts != null && this._counts.Count > 0; } /// /// Gets and sets the property Dimensions. /// /// The dimensions associated with the metric. /// /// [AWSProperty(Max=30)] public List Dimensions { get { return this._dimensions; } set { this._dimensions = value; } } // Check to see if Dimensions property is set internal bool IsSetDimensions() { return this._dimensions != null && this._dimensions.Count > 0; } /// /// Gets and sets the property MetricName. /// /// The name of the metric. /// /// [AWSProperty(Required=true, Min=1, Max=255)] public string MetricName { get { return this._metricName; } set { this._metricName = value; } } // Check to see if MetricName property is set internal bool IsSetMetricName() { return this._metricName != null; } /// /// Gets and sets the property StatisticValues. /// /// The statistical values for the metric. /// /// public StatisticSet StatisticValues { get { return this._statisticValues; } set { this._statisticValues = value; } } // Check to see if StatisticValues property is set internal bool IsSetStatisticValues() { return this._statisticValues != null; } /// /// Gets and sets the property StorageResolution. /// /// Valid values are 1 and 60. Setting this to 1 specifies this metric as a high-resolution /// metric, so that CloudWatch stores the metric with sub-minute resolution down to one /// second. Setting this to 60 specifies this metric as a regular-resolution metric, which /// CloudWatch stores at 1-minute resolution. Currently, high resolution is available /// only for custom metrics. For more information about high-resolution metrics, see High-Resolution /// Metrics in the Amazon CloudWatch User Guide. /// /// /// /// This field is optional, if you do not specify it the default of 60 is used. /// /// [AWSProperty(Min=1)] public int StorageResolution { get { return this._storageResolution.GetValueOrDefault(); } set { this._storageResolution = value; } } // Check to see if StorageResolution property is set internal bool IsSetStorageResolution() { return this._storageResolution.HasValue; } /// /// Gets and sets the property TimestampUtc. /// /// The time the metric data was received, expressed as the number of milliseconds since /// Jan 1, 1970 00:00:00 UTC. /// /// public DateTime TimestampUtc { get { return this._timestampUtc.GetValueOrDefault(); } set { this._timestamp = this._timestampUtc = value; } } // Check to see if TimestampUtc property is set internal bool IsSetTimestampUtc() { return this._timestampUtc.HasValue; } /// /// 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, this displays the unit that is used for the metric. /// /// 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; } /// /// Gets and sets the property Value. /// /// The value for the metric. /// /// /// /// Although the parameter accepts numbers of type Double, CloudWatch rejects values that /// are either too small or too large. Values must be in the range of -2^360 to 2^360. /// In addition, special values (for example, NaN, +Infinity, -Infinity) are not supported. /// /// public double Value { get { return this._value.GetValueOrDefault(); } set { this._value = value; } } // Check to see if Value property is set internal bool IsSetValue() { return this._value.HasValue; } /// /// Gets and sets the property Values. /// /// Array of numbers representing the values for the metric during the period. Each unique /// value is listed just once in this array, and the corresponding number in the Counts /// array specifies the number of times that value occurred during the period. You can /// include up to 150 unique values in each PutMetricData action that specifies /// a Values array. /// /// /// /// Although the Values array accepts numbers of type Double, /// CloudWatch rejects values that are either too small or too large. Values must be in /// the range of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, /// -Infinity) are not supported. /// /// public List Values { get { return this._values; } set { this._values = value; } } // Check to see if Values property is set internal bool IsSetValues() { return this._values != null && this._values.Count > 0; } #region Backwards compatible properties private DateTime? _timestamp; /// /// Gets and sets the property TimestampUtc. /// /// This property is deprecated. Setting this property results in non-UTC DateTimes not /// being marshalled correctly. Use TimestampUtc instead. Setting either Timestamp or /// TimestampUtc results in both Timestamp and TimestampUtc being assigned, the latest /// assignment to either one of the two property is reflected in the value of both. Timestamp /// is provided for backwards compatibility only and assigning a non-Utc DateTime to it /// results in the wrong timestamp being passed to the service. /// /// /// /// The time the metric data was received, expressed as the number of milliseconds since /// Jan 1, 1970 00:00:00 UTC. /// /// [Obsolete("Setting this property results in non-UTC DateTimes not being marshalled correctly. " + "Use TimestampUtc instead. Setting either Timestamp or TimestampUtc results in both Timestamp and " + "TimestampUtc being assigned, the latest assignment to either one of the two property is " + "reflected in the value of both. Timestamp is provided for backwards compatibility only and " + "assigning a non-Utc DateTime to it results in the wrong timestamp being passed to the service.", false)] public DateTime Timestamp { get { return this._timestamp.GetValueOrDefault(); } set { this._timestamp = value; this._timestampUtc = new DateTime(value.Ticks, DateTimeKind.Utc); } } #endregion } }