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

/**
 * Information about the identity, status, health, node name, uptime, and other
 * details about the replica.
 *
 */
class ReplicaInfo {
  /**
   * Create a ReplicaInfo.
   * @property {string} [replicaStatus] The status of a replica of a service.
   * Possible values include: 'Invalid', 'InBuild', 'Standby', 'Ready', 'Down',
   * 'Dropped'
   * @property {string} [healthState] The health state of a Service Fabric
   * entity such as Cluster, Node, Application, Service, Partition, Replica
   * etc. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error',
   * 'Unknown'
   * @property {string} [nodeName] The name of a Service Fabric node.
   * @property {string} [address] The address the replica is listening on.
   * @property {string} [lastInBuildDurationInSeconds] The last in build
   * duration of the replica in seconds.
   * @property {string} serviceKind Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of ReplicaInfo
   *
   * @returns {object} metadata of ReplicaInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ReplicaInfo',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'ServiceKind',
          clientName: 'serviceKind'
        },
        uberParent: 'ReplicaInfo',
        className: 'ReplicaInfo',
        modelProperties: {
          replicaStatus: {
            required: false,
            serializedName: 'ReplicaStatus',
            type: {
              name: 'String'
            }
          },
          healthState: {
            required: false,
            serializedName: 'HealthState',
            type: {
              name: 'String'
            }
          },
          nodeName: {
            required: false,
            serializedName: 'NodeName',
            type: {
              name: 'String'
            }
          },
          address: {
            required: false,
            serializedName: 'Address',
            type: {
              name: 'String'
            }
          },
          lastInBuildDurationInSeconds: {
            required: false,
            serializedName: 'LastInBuildDurationInSeconds',
            type: {
              name: 'String'
            }
          },
          serviceKind: {
            required: true,
            serializedName: 'ServiceKind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ReplicaInfo;
