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

/**
 * Represents load information for a partition, which contains the primary and
 * secondary reported load metrics.
 * In case there is no load reported, PartitionLoadInformation will contain the
 * default load for the service of the partition.
 * For default loads, LoadMetricReport's LastReportedUtc is set to 0.
 *
 */
class PartitionLoadInformation {
  /**
   * Create a PartitionLoadInformation.
   * @property {uuid} [partitionId] Id of the partition.
   * @property {array} [primaryLoadMetricReports] Array of load reports from
   * the primary replica for this partition.
   * @property {array} [secondaryLoadMetricReports] Array of aggregated load
   * reports from all secondary replicas for this partition.
   * Array only contains the latest reported load for each metric.
   */
  constructor() {
  }

  /**
   * Defines the metadata of PartitionLoadInformation
   *
   * @returns {object} metadata of PartitionLoadInformation
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'PartitionLoadInformation',
      type: {
        name: 'Composite',
        className: 'PartitionLoadInformation',
        modelProperties: {
          partitionId: {
            required: false,
            serializedName: 'PartitionId',
            type: {
              name: 'String'
            }
          },
          primaryLoadMetricReports: {
            required: false,
            serializedName: 'PrimaryLoadMetricReports',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'LoadMetricReportElementType',
                  type: {
                    name: 'Composite',
                    className: 'LoadMetricReport'
                  }
              }
            }
          },
          secondaryLoadMetricReports: {
            required: false,
            serializedName: 'SecondaryLoadMetricReports',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'LoadMetricReportElementType',
                  type: {
                    name: 'Composite',
                    className: 'LoadMetricReport'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = PartitionLoadInformation;
