/*
 * 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 of the stateless service instance, which
 * contains the instance ID and the aggregated health state.
 *
 * @extends models['ReplicaHealthState']
 */
class StatelessServiceInstanceHealthState extends models['ReplicaHealthState'] {
  /**
   * Create a StatelessServiceInstanceHealthState.
   * @property {string} [replicaId] Id of the stateless service instance on the
   * wire this field is called ReplicaId.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of StatelessServiceInstanceHealthState
   *
   * @returns {object} metadata of StatelessServiceInstanceHealthState
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Stateless',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'ServiceKind',
          clientName: 'serviceKind'
        },
        uberParent: 'EntityHealthState',
        className: 'StatelessServiceInstanceHealthState',
        modelProperties: {
          aggregatedHealthState: {
            required: false,
            serializedName: 'AggregatedHealthState',
            type: {
              name: 'String'
            }
          },
          partitionId: {
            required: false,
            serializedName: 'PartitionId',
            type: {
              name: 'String'
            }
          },
          serviceKind: {
            required: true,
            serializedName: 'ServiceKind',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          replicaId: {
            required: false,
            serializedName: 'ReplicaId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = StatelessServiceInstanceHealthState;
