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

/**
 * At least one of manual or autoScale settings must be specified. Only one of
 * manual or autoScale settings can be specified. If autoScale settings are
 * specified, the system automatically scales the cluster up and down (within
 * the supplied limits) based on the pending jobs on the cluster.
 *
 */
class ScaleSettings {
  /**
   * Create a ScaleSettings.
   * @member {object} [manual] Manual scale settings. Manual scale settings for
   * the cluster.
   * @member {number} [manual.targetNodeCount] The desired number of compute
   * nodes in the Cluster. Default is 0.
   * @member {string} [manual.nodeDeallocationOption] An action to be performed
   * when the cluster size is decreasing. The default value is requeue.
   * Possible values include: 'requeue', 'terminate', 'waitforjobcompletion'
   * @member {object} [autoScale] Auto-scale settings. Auto-scale settings for
   * the cluster.
   * @member {number} [autoScale.minimumNodeCount] The minimum number of
   * compute nodes the Batch AI service will try to allocate for the cluster.
   * Note, the actual number of nodes can be less than the specified value if
   * the subscription has not enough quota to fulfill the request.
   * @member {number} [autoScale.maximumNodeCount] The maximum number of
   * compute nodes the cluster can have.
   * @member {number} [autoScale.initialNodeCount] The number of compute nodes
   * to allocate on cluster creation. Note that this value is used only during
   * cluster creation. Default: 0.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ScaleSettings
   *
   * @returns {object} metadata of ScaleSettings
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ScaleSettings',
      type: {
        name: 'Composite',
        className: 'ScaleSettings',
        modelProperties: {
          manual: {
            required: false,
            serializedName: 'manual',
            type: {
              name: 'Composite',
              className: 'ManualScaleSettings'
            }
          },
          autoScale: {
            required: false,
            serializedName: 'autoScale',
            type: {
              name: 'Composite',
              className: 'AutoScaleSettings'
            }
          }
        }
      }
    };
  }
}

module.exports = ScaleSettings;
