text: /*
   * 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';
  
  /**
   * Describes an upgrade policy - automatic, manual, or rolling.
   *
   */
  class UpgradePolicy {
    /**
     * Create a UpgradePolicy.
     * @property {string} [mode] Specifies the mode of an upgrade to virtual
     * machines in the scale set.<br /><br /> Possible values are:<br /><br />
     * **Manual** - You  control the application of updates to virtual machines
     * in the scale set. You do this by using the manualUpgrade action.<br /><br
     * /> **Automatic** - All virtual machines in the scale set are
     * automatically updated at the same time. Possible values include:
     * 'Automatic', 'Manual', 'Rolling'
     * @property {object} [rollingUpgradePolicy] The configuration parameters
     * used while performing a rolling upgrade.
     * @property {number} [rollingUpgradePolicy.maxBatchInstancePercent] The
     * maximum percent of total virtual machine instances that will be upgraded
     * simultaneously by the rolling upgrade in one batch. As this is a maximum,
     * unhealthy instances in previous or future batches can cause the percentage
     * of instances in a batch to decrease to ensure higher reliability. The
     * default value for this parameter is 20%.
     * @property {number} [rollingUpgradePolicy.maxUnhealthyInstancePercent] The
     * maximum percentage of the total virtual machine instances in the scale set
     * that can be simultaneously unhealthy, either as a result of being
     * upgraded, or by being found in an unhealthy state by the virtual machine
     * health checks before the rolling upgrade aborts. This constraint will be
     * checked prior to starting any batch. The default value for this parameter
     * is 20%.
     * @property {number}
     * [rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] The maximum
     * percentage of upgraded virtual machine instances that can be found to be
     * in an unhealthy state. This check will happen after each batch is
     * upgraded. If this percentage is ever exceeded, the rolling update aborts.
     * The default value for this parameter is 20%.
     * @property {string} [rollingUpgradePolicy.pauseTimeBetweenBatches] The wait
     * time between completing the update for all virtual machines in one batch
     * and starting the next batch. The time duration should be specified in ISO
     * 8601 format. The default value is 0 seconds (PT0S).
     * @property {object} [automaticOSUpgradePolicy] Configuration parameters
     * used for performing automatic OS Upgrade.
     * @property {boolean} [automaticOSUpgradePolicy.enableAutomaticOSUpgrade]
     * Whether OS upgrades should automatically be applied to scale set instances
     * in a rolling fashion when a newer version of the image becomes available.
     * Default value is false.
     * @property {boolean} [automaticOSUpgradePolicy.disableAutomaticRollback]
     * Whether OS image rollback feature should be disabled. Default value is
     * false.
     */
    constructor() {
    }
  
    /**
     * Defines the metadata of UpgradePolicy
     *
     * @returns {object} metadata of UpgradePolicy
     *
     */
    mapper() {
      return {
        required: false,
        serializedName: 'UpgradePolicy',
        type: {
          name: 'Composite',
          className: 'UpgradePolicy',
          modelProperties: {
            mode: {
              required: false,
              serializedName: 'mode',
              type: {
                name: 'Enum',
                allowedValues: [ 'Automatic', 'Manual', 'Rolling' ]
              }
            },
            rollingUpgradePolicy: {
              required: false,
              serializedName: 'rollingUpgradePolicy',
              type: {
                name: 'Composite',
                className: 'RollingUpgradePolicy'
              }
            },
            automaticOSUpgradePolicy: {
              required: false,
              serializedName: 'automaticOSUpgradePolicy',
              type: {
                name: 'Composite',
                className: 'AutomaticOSUpgradePolicy'
              }
            }
          }
        }
      };
    }
  }
  
  module.exports = UpgradePolicy;
  