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

/**
 * Represents the health state chunk of a stateful service replica or a
 * stateless service instance.
 * The replica health state contains the replica ID and its aggregated health
 * state.
 *
 * @extends models['EntityHealthStateChunk']
 */
class ReplicaHealthStateChunk extends models['EntityHealthStateChunk'] {
  /**
   * Create a ReplicaHealthStateChunk.
   * @property {string} [replicaOrInstanceId] Id of a stateful service replica
   * or a stateless service instance. This ID is used in the queries that apply
   * to both stateful and stateless services. It is used by Service Fabric to
   * uniquely identify a replica of a partition of a stateful service or an
   * instance of a stateless service partition. It is unique within a partition
   * and does not change for the lifetime of the replica or the instance. If a
   * stateful replica gets dropped and another replica gets created on the same
   * node for the same partition, it will get a different value for the ID. If
   * a stateless instance is failed over on the same or different node it will
   * get a different value for the ID.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ReplicaHealthStateChunk
   *
   * @returns {object} metadata of ReplicaHealthStateChunk
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ReplicaHealthStateChunk',
      type: {
        name: 'Composite',
        className: 'ReplicaHealthStateChunk',
        modelProperties: {
          healthState: {
            required: false,
            serializedName: 'HealthState',
            type: {
              name: 'String'
            }
          },
          replicaOrInstanceId: {
            required: false,
            serializedName: 'ReplicaOrInstanceId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ReplicaHealthStateChunk;
