/*
 * 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 service, which contains the service
 * name, its aggregated health state and any partitions that respect the
 * filters in the cluster health chunk query description.
 *
 * @extends models['EntityHealthStateChunk']
 */
class ServiceHealthStateChunk extends models['EntityHealthStateChunk'] {
  /**
   * Create a ServiceHealthStateChunk.
   * @property {string} [serviceName] The name of the service whose health
   * state chunk is provided in this object.
   * @property {object} [partitionHealthStateChunks] The list of partition
   * health state chunks belonging to the service that respect the filters in
   * the cluster health chunk query description.
   * @property {array} [partitionHealthStateChunks.items] The list of partition
   * health state chunks that respect the input filters in the chunk query.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ServiceHealthStateChunk
   *
   * @returns {object} metadata of ServiceHealthStateChunk
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ServiceHealthStateChunk',
      type: {
        name: 'Composite',
        className: 'ServiceHealthStateChunk',
        modelProperties: {
          healthState: {
            required: false,
            serializedName: 'HealthState',
            type: {
              name: 'String'
            }
          },
          serviceName: {
            required: false,
            serializedName: 'ServiceName',
            type: {
              name: 'String'
            }
          },
          partitionHealthStateChunks: {
            required: false,
            serializedName: 'PartitionHealthStateChunks',
            type: {
              name: 'Composite',
              className: 'PartitionHealthStateChunkList'
            }
          }
        }
      }
    };
  }
}

module.exports = ServiceHealthStateChunk;
