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

/**
 * The result data of a query.
 *
 */
class Metric {
  /**
   * Create a Metric.
   * @property {string} id the metric Id.
   * @property {string} type the resource type of the metric resource.
   * @property {object} name the name and the display name of the metric, i.e.
   * it is localizable string.
   * @property {string} [name.value] the invariant value.
   * @property {string} [name.localizedValue] the locale specific value.
   * @property {string} unit the unit of the metric. Possible values include:
   * 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond',
   * 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified'
   * @property {array} timeseries the time series returned when a data query is
   * performed.
   */
  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: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          type: {
            required: true,
            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', 'ByteSeconds', 'Unspecified' ]
            }
          },
          timeseries: {
            required: true,
            serializedName: 'timeseries',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'TimeSeriesElementElementType',
                  type: {
                    name: 'Composite',
                    className: 'TimeSeriesElement'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = Metric;
