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

/**
 * Defines a health policy used to evaluate the health of the cluster during a
 * cluster upgrade.
 *
 */
class ClusterUpgradeHealthPolicyObject {
  /**
   * Create a ClusterUpgradeHealthPolicyObject.
   * @property {number} [maxPercentDeltaUnhealthyNodes] The maximum allowed
   * percentage of nodes health degradation allowed during cluster upgrades.
   * The delta is measured between the state of the nodes at the beginning of
   * upgrade and the state of the nodes at the time of the health evaluation.
   * The check is performed after every upgrade domain upgrade completion to
   * make sure the global state of the cluster is within tolerated limits. The
   * default value is 10%.
   * @property {number} [maxPercentUpgradeDomainDeltaUnhealthyNodes] The
   * maximum allowed percentage of upgrade domain nodes health degradation
   * allowed during cluster upgrades. The delta is measured between the state
   * of the upgrade domain nodes at the beginning of upgrade and the state of
   * the upgrade domain nodes at the time of the health evaluation. The check
   * is performed after every upgrade domain upgrade completion for all
   * completed upgrade domains to make sure the state of the upgrade domains is
   * within tolerated limits. The default value is 15%.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ClusterUpgradeHealthPolicyObject
   *
   * @returns {object} metadata of ClusterUpgradeHealthPolicyObject
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ClusterUpgradeHealthPolicyObject',
      type: {
        name: 'Composite',
        className: 'ClusterUpgradeHealthPolicyObject',
        modelProperties: {
          maxPercentDeltaUnhealthyNodes: {
            required: false,
            serializedName: 'MaxPercentDeltaUnhealthyNodes',
            constraints: {
              InclusiveMaximum: 100,
              InclusiveMinimum: 0
            },
            type: {
              name: 'Number'
            }
          },
          maxPercentUpgradeDomainDeltaUnhealthyNodes: {
            required: false,
            serializedName: 'MaxPercentUpgradeDomainDeltaUnhealthyNodes',
            constraints: {
              InclusiveMaximum: 100,
              InclusiveMinimum: 0
            },
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = ClusterUpgradeHealthPolicyObject;
