/*
 * 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 OData filters to be used for metrics.
 *
 */
class MetricFilter {
  /**
   * Create a MetricFilter.
   * @member {object} [name] Specifies the metric name filter specifying the
   * name of the metric to be filtered on. Only 'Equality' operator is
   * supported for this property.
   * @member {string} [name.value] Specifies the metric name to be filtered on.
   * E.g., CloudStorageUsed. Valid values are the ones returned in the field
   * "name" in the ListMetricDefinitions call. Only 'Equality' operator is
   * supported for this property.
   * @member {date} [startTime] Specifies the start time of the time range to
   * be queried. Only 'Greater Than Or Equal To' operator is supported for this
   * property.
   * @member {date} [endTime] Specifies the end time of the time range to be
   * queried. Only 'Less Than Or Equal To' operator is supported for this
   * property.
   * @member {string} [timeGrain] Specifies the time granularity of the metrics
   * to be returned. E.g., "P1D". Valid values are the ones returned as the
   * field "timeGrain" in the ListMetricDefinitions call. Only 'Equality'
   * operator is supported for this property.
   * @member {string} category Specifies the category of the metrics to be
   * filtered. E.g., "CapacityUtilization". Valid values are the ones returned
   * as the field "category" in the ListMetricDefinitions call. Only 'Equality'
   * operator is supported for this property.
   * @member {object} [dimensions] Specifies the source(the dimension) of the
   * metrics to be filtered. Only 'Equality' operator is supported for this
   * property.
   * @member {string} [dimensions.name] Specifies the dimension name. E.g.,
   * NetworkInterface. Valid values are the ones specified in the field
   * "dimensions" in the ListMetricDefinitions call. Only 'Equality' operator
   * is supported for this property.
   * @member {string} [dimensions.values] Specifies the dimension value. E.g.,
   * Data0. Valid values are the ones returned in the field "dimensions" in the
   * ListMetricDefinitions call. Only 'Equality' operator is supported for this
   * property.
   */
  constructor() {
  }

  /**
   * Defines the metadata of MetricFilter
   *
   * @returns {object} metadata of MetricFilter
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'MetricFilter',
      type: {
        name: 'Composite',
        className: 'MetricFilter',
        modelProperties: {
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'Composite',
              className: 'MetricNameFilter'
            }
          },
          startTime: {
            required: false,
            serializedName: 'startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            serializedName: 'endTime',
            type: {
              name: 'DateTime'
            }
          },
          timeGrain: {
            required: false,
            serializedName: 'timeGrain',
            type: {
              name: 'String'
            }
          },
          category: {
            required: true,
            serializedName: 'category',
            type: {
              name: 'String'
            }
          },
          dimensions: {
            required: false,
            serializedName: 'dimensions',
            type: {
              name: 'Composite',
              className: 'DimensionFilter'
            }
          }
        }
      }
    };
  }
}

module.exports = MetricFilter;
