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

/**
 * Class representing a PrimaryReplicatorStatus.
 * @extends models['ReplicatorStatus']
 */
class PrimaryReplicatorStatus extends models['ReplicatorStatus'] {
  /**
   * Create a PrimaryReplicatorStatus.
   * @member {object} [replicationQueueStatus]
   * @member {number} [replicationQueueStatus.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.
   * @member {string} [replicationQueueStatus.queueMemorySize] Represents the
   * virtual memory consumed by the queue in bytes.
   * @member {string} [replicationQueueStatus.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.
   * @member {string} [replicationQueueStatus.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.
   * @member {string} [replicationQueueStatus.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.
   * @member {string} [replicationQueueStatus.lastSequenceNumber] Represents
   * the latest sequence number of the operation that is available in the
   * queue.
   * @member {array} [remoteReplicators]
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of PrimaryReplicatorStatus
   *
   * @returns {object} metadata of PrimaryReplicatorStatus
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Primary',
      type: {
        name: 'Composite',
        className: 'PrimaryReplicatorStatus',
        modelProperties: {
          kind: {
            required: true,
            serializedName: 'Kind',
            type: {
              name: 'String'
            }
          },
          replicationQueueStatus: {
            required: false,
            serializedName: 'ReplicationQueueStatus',
            type: {
              name: 'Composite',
              className: 'ReplicatorQueueStatus'
            }
          },
          remoteReplicators: {
            required: false,
            serializedName: 'RemoteReplicators',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'RemoteReplicatorStatusElementType',
                  type: {
                    name: 'Composite',
                    className: 'RemoteReplicatorStatus'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = PrimaryReplicatorStatus;
