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

/**
 * A database metric definition.
 *
 */
class MetricDefinition {
  /**
   * Create a MetricDefinition.
   * @member {object} [name] The name information for the metric.
   * @member {string} [name.value] The name of the database metric.
   * @member {string} [name.localizedValue] The friendly name of the database
   * metric.
   * @member {string} [primaryAggregationType] The primary aggregation type
   * defining how metric values are displayed. Possible values include: 'None',
   * 'Average', 'Count', 'Minimum', 'Maximum', 'Total'
   * @member {string} [resourceUri] The resource uri of the database.
   * @member {string} [unit] The unit of the metric. Possible values include:
   * 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond'
   * @member {array} [metricAvailabilities] The list of database metric
   * availabities for the metric.
   */
  constructor() {
  }

  /**
   * Defines the metadata of MetricDefinition
   *
   * @returns {object} metadata of MetricDefinition
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'MetricDefinition',
      type: {
        name: 'Composite',
        className: 'MetricDefinition',
        modelProperties: {
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'Composite',
              className: 'MetricName'
            }
          },
          primaryAggregationType: {
            required: false,
            readOnly: true,
            serializedName: 'primaryAggregationType',
            type: {
              name: 'String'
            }
          },
          resourceUri: {
            required: false,
            readOnly: true,
            serializedName: 'resourceUri',
            type: {
              name: 'String'
            }
          },
          unit: {
            required: false,
            readOnly: true,
            serializedName: 'unit',
            type: {
              name: 'String'
            }
          },
          metricAvailabilities: {
            required: false,
            readOnly: true,
            serializedName: 'metricAvailabilities',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'MetricAvailabilityElementType',
                  type: {
                    name: 'Composite',
                    className: 'MetricAvailability'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = MetricDefinition;
