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

/**
 * @class
 * Initializes a new instance of the Metric class.
 * @constructor
 * A set of metric values in a time range.
 *
 * @member {string} [id] the id, resourceId, of the metric.
 *
 * @member {string} [type] the resource type of the metric resource.
 *
 * @member {object} name the name and the display name of the metric, i.e. it
 * is localizable string.
 *
 * @member {string} [name.value] the invariant value.
 *
 * @member {string} [name.localizedValue] the locale specific value.
 *
 * @member {string} unit the unit of the metric. Possible values include:
 * 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', 'Percent',
 * 'MilliSeconds'
 *
 * @member {array} data Array of data points representing the metric values.
 *
 */
class Metric {
  constructor() {
  }

  /**
   * Defines the metadata of Metric
   *
   * @returns {object} metadata of Metric
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Metric',
      type: {
        name: 'Composite',
        className: 'Metric',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          name: {
            required: true,
            serializedName: 'name',
            type: {
              name: 'Composite',
              className: 'LocalizableString'
            }
          },
          unit: {
            required: true,
            serializedName: 'unit',
            type: {
              name: 'Enum',
              allowedValues: [ 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', 'Percent', 'MilliSeconds' ]
            }
          },
          data: {
            required: true,
            serializedName: 'data',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'MetricValueElementType',
                  type: {
                    name: 'Composite',
                    className: 'MetricValue'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = Metric;
