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

/**
 * Object representing a metric for any resource .
 *
 */
class ResourceMetric {
  /**
   * Create a ResourceMetric.
   * @member {object} [name] Name of metric.
   * @member {string} [name.value] metric name value.
   * @member {string} [name.localizedValue] Localized metric name value.
   * @member {string} [unit] Metric unit.
   * @member {string} [timeGrain] Metric granularity. E.g PT1H, PT5M, P1D
   * @member {date} [startTime] Metric start time.
   * @member {date} [endTime] Metric end time.
   * @member {string} [resourceId] Metric resource Id.
   * @member {string} [id] Resource Id.
   * @member {array} [metricValues] Metric values.
   * @member {array} [properties] Resource metric properties collection.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ResourceMetric
   *
   * @returns {object} metadata of ResourceMetric
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ResourceMetric',
      type: {
        name: 'Composite',
        className: 'ResourceMetric',
        modelProperties: {
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'Composite',
              className: 'ResourceMetricName'
            }
          },
          unit: {
            required: false,
            readOnly: true,
            serializedName: 'unit',
            type: {
              name: 'String'
            }
          },
          timeGrain: {
            required: false,
            readOnly: true,
            serializedName: 'timeGrain',
            type: {
              name: 'String'
            }
          },
          startTime: {
            required: false,
            readOnly: true,
            serializedName: 'startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            readOnly: true,
            serializedName: 'endTime',
            type: {
              name: 'DateTime'
            }
          },
          resourceId: {
            required: false,
            readOnly: true,
            serializedName: 'resourceId',
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          metricValues: {
            required: false,
            readOnly: true,
            serializedName: 'metricValues',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ResourceMetricValueElementType',
                  type: {
                    name: 'Composite',
                    className: 'ResourceMetricValue'
                  }
              }
            }
          },
          properties: {
            required: false,
            readOnly: true,
            serializedName: 'properties',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ResourceMetricPropertyElementType',
                  type: {
                    name: 'Composite',
                    className: 'ResourceMetricProperty'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = ResourceMetric;
