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

/**
 * Provides various statistics of the queue used in the service fabric
 * replicator.
 * Contains information about the service fabric replicator like the
 * replication/copy queue utilization, last acknowledgement received timestamp,
 * etc.
 * Depending on the role of the replicator, the properties in this type imply
 * different meanings.
 *
 */
class ReplicatorQueueStatus {
  /**
   * Create a ReplicatorQueueStatus.
   * @property {number} [queueUtilizationPercentage] Represents the utilization
   * of the queue. A value of 0 indicates that the queue is empty and a value
   * of 100 indicates the queue is full.
   * @property {string} [queueMemorySize] Represents the virtual memory
   * consumed by the queue in bytes.
   * @property {string} [firstSequenceNumber] On a primary replicator, this is
   * semantically the sequence number of the operation for which all the
   * secondary replicas have sent an acknowledgement.
   * On a secondary replicator, this is the smallest sequence number of the
   * operation that is present in the queue.
   * @property {string} [completedSequenceNumber] On a primary replicator, this
   * is semantically the highest sequence number of the operation for which all
   * the secondary replicas have sent an acknowledgement.
   * On a secondary replicator, this is semantically the highest sequence
   * number that has been applied to the persistent state.
   * @property {string} [committedSequenceNumber] On a primary replicator, this
   * is semantically the highest sequence number of the operation for which a
   * write quorum of the secondary replicas have sent an acknowledgement.
   * On a secondary replicator, this is semantically the highest sequence
   * number of the in-order operation received from the primary.
   * @property {string} [lastSequenceNumber] Represents the latest sequence
   * number of the operation that is available in the queue.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ReplicatorQueueStatus
   *
   * @returns {object} metadata of ReplicatorQueueStatus
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ReplicatorQueueStatus',
      type: {
        name: 'Composite',
        className: 'ReplicatorQueueStatus',
        modelProperties: {
          queueUtilizationPercentage: {
            required: false,
            serializedName: 'QueueUtilizationPercentage',
            type: {
              name: 'Number'
            }
          },
          queueMemorySize: {
            required: false,
            serializedName: 'QueueMemorySize',
            type: {
              name: 'String'
            }
          },
          firstSequenceNumber: {
            required: false,
            serializedName: 'FirstSequenceNumber',
            type: {
              name: 'String'
            }
          },
          completedSequenceNumber: {
            required: false,
            serializedName: 'CompletedSequenceNumber',
            type: {
              name: 'String'
            }
          },
          committedSequenceNumber: {
            required: false,
            serializedName: 'CommittedSequenceNumber',
            type: {
              name: 'String'
            }
          },
          lastSequenceNumber: {
            required: false,
            serializedName: 'LastSequenceNumber',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ReplicatorQueueStatus;
