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

/**
 * Represents the health chunk of the cluster.
 * Contains the cluster aggregated health state, and the cluster entities that
 * respect the input filter.
 *
 */
class ClusterHealthChunk {
  /**
   * Create a ClusterHealthChunk.
   * @property {string} [healthState] The HealthState representing the
   * aggregated health state of the cluster computed by Health Manager.
   * The health evaluation of the entity reflects all events reported on the
   * entity and its children (if any).
   * The aggregation is done by applying the desired cluster health policy and
   * the application health policies. Possible values include: 'Invalid', 'Ok',
   * 'Warning', 'Error', 'Unknown'
   * @property {object} [nodeHealthStateChunks] The list of node health state
   * chunks in the cluster that respect the filters in the cluster health chunk
   * query description.
   * @property {array} [nodeHealthStateChunks.items] The list of node health
   * state chunks that respect the input filters in the chunk query.
   * @property {object} [applicationHealthStateChunks] The list of application
   * health state chunks in the cluster that respect the filters in the cluster
   * health chunk query description.
   * @property {array} [applicationHealthStateChunks.items] The list of
   * application health state chunks that respect the input filters in the
   * chunk query.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ClusterHealthChunk
   *
   * @returns {object} metadata of ClusterHealthChunk
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ClusterHealthChunk',
      type: {
        name: 'Composite',
        className: 'ClusterHealthChunk',
        modelProperties: {
          healthState: {
            required: false,
            serializedName: 'HealthState',
            type: {
              name: 'String'
            }
          },
          nodeHealthStateChunks: {
            required: false,
            serializedName: 'NodeHealthStateChunks',
            type: {
              name: 'Composite',
              className: 'NodeHealthStateChunkList'
            }
          },
          applicationHealthStateChunks: {
            required: false,
            serializedName: 'ApplicationHealthStateChunks',
            type: {
              name: 'Composite',
              className: 'ApplicationHealthStateChunkList'
            }
          }
        }
      }
    };
  }
}

module.exports = ClusterHealthChunk;
