/*
 * 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';

const models = require('./index');

/**
 * The monitoring metric.
 *
 */
class Metrics {
  /**
   * Create a Metrics.
   * @member {string} [resourceId] The ID of metric source.
   * @member {date} [startTime] The start time of the metric data.
   * @member {date} [endTime] The end time of the metric data.
   * @member {string} [timeGrain] The time granularity of the metric data.
   * @member {string} [primaryAggregation] The metric aggregation type.
   * Possible values include: 'Average', 'Last', 'Maximum', 'Minimum', 'None',
   * 'Total'
   * @member {object} [name] The name of the metric.
   * @member {string} [name.value] The metric name.
   * @member {string} [name.localizedValue] The localized metric name.
   * @member {array} [dimensions] The metric dimensions.
   * @member {string} [unit] The unit of the metric data. Possible values
   * include: 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent',
   * 'Seconds'
   * @member {string} [type] The type of the metric data.
   * @member {array} [values] The list of the metric data.
   */
  constructor() {
  }

  /**
   * Defines the metadata of Metrics
   *
   * @returns {object} metadata of Metrics
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Metrics',
      type: {
        name: 'Composite',
        className: 'Metrics',
        modelProperties: {
          resourceId: {
            required: false,
            serializedName: 'resourceId',
            type: {
              name: 'String'
            }
          },
          startTime: {
            required: false,
            serializedName: 'startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            serializedName: 'endTime',
            type: {
              name: 'DateTime'
            }
          },
          timeGrain: {
            required: false,
            serializedName: 'timeGrain',
            type: {
              name: 'String'
            }
          },
          primaryAggregation: {
            required: false,
            serializedName: 'primaryAggregation',
            type: {
              name: 'Enum',
              allowedValues: [ 'Average', 'Last', 'Maximum', 'Minimum', 'None', 'Total' ]
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'Composite',
              className: 'MetricName'
            }
          },
          dimensions: {
            required: false,
            serializedName: 'dimensions',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'MetricDimensionElementType',
                  type: {
                    name: 'Composite',
                    className: 'MetricDimension'
                  }
              }
            }
          },
          unit: {
            required: false,
            serializedName: 'unit',
            type: {
              name: 'Enum',
              allowedValues: [ 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', 'Seconds' ]
            }
          },
          type: {
            required: false,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          values: {
            required: false,
            serializedName: 'values',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'MetricDataElementType',
                  type: {
                    name: 'Composite',
                    className: 'MetricData'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = Metrics;
