/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

/**
 * Represents a metric value.
 *
 */
class MetricValue {
  /**
   * Create a MetricValue.
   * @property {date} timeStamp the timestamp for the metric value in ISO 8601
   * format.
   * @property {number} [average] the average value in the time range.
   * @property {number} [minimum] the least value in the time range.
   * @property {number} [maximum] the greatest value in the time range.
   * @property {number} [total] the sum of all of the values in the time range.
   * @property {number} [count] the number of samples in the time range. Can be
   * used to determine the number of values that contributed to the average
   * value.
   */
  constructor() {
  }

  /**
   * Defines the metadata of MetricValue
   *
   * @returns {object} metadata of MetricValue
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'MetricValue',
      type: {
        name: 'Composite',
        className: 'MetricValue',
        modelProperties: {
          timeStamp: {
            required: true,
            serializedName: 'timeStamp',
            type: {
              name: 'DateTime'
            }
          },
          average: {
            required: false,
            serializedName: 'average',
            type: {
              name: 'Number'
            }
          },
          minimum: {
            required: false,
            serializedName: 'minimum',
            type: {
              name: 'Number'
            }
          },
          maximum: {
            required: false,
            serializedName: 'maximum',
            type: {
              name: 'Number'
            }
          },
          total: {
            required: false,
            serializedName: 'total',
            type: {
              name: 'Number'
            }
          },
          count: {
            required: false,
            serializedName: 'count',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = MetricValue;
