/*
 * 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 metric values for a single partition.
 *
 * @extends models['Metric']
 */
class PartitionMetric extends models['Metric'] {
  /**
   * Create a PartitionMetric.
   * @member {string} [partitionId] The parition id (GUID identifier) of the
   * metric values.
   * @member {string} [partitionKeyRangeId] The partition key range id (integer
   * identifier) of the metric values.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of PartitionMetric
   *
   * @returns {object} metadata of PartitionMetric
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'PartitionMetric',
      type: {
        name: 'Composite',
        className: 'PartitionMetric',
        modelProperties: {
          startTime: {
            required: false,
            readOnly: true,
            serializedName: 'startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            readOnly: true,
            serializedName: 'endTime',
            type: {
              name: 'DateTime'
            }
          },
          timeGrain: {
            required: false,
            readOnly: true,
            serializedName: 'timeGrain',
            type: {
              name: 'String'
            }
          },
          unit: {
            required: false,
            serializedName: 'unit',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'Composite',
              className: 'MetricName'
            }
          },
          metricValues: {
            required: false,
            readOnly: true,
            serializedName: 'metricValues',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'MetricValueElementType',
                  type: {
                    name: 'Composite',
                    className: 'MetricValue'
                  }
              }
            }
          },
          partitionId: {
            required: false,
            readOnly: true,
            serializedName: 'partitionId',
            type: {
              name: 'String'
            }
          },
          partitionKeyRangeId: {
            required: false,
            readOnly: true,
            serializedName: 'partitionKeyRangeId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = PartitionMetric;
