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

/**
 * @summary Fixed scale settings for the pool.
  *
 */
class FixedScaleSettings {
  /**
   * Create a FixedScaleSettings.
   * @property {moment.duration} [resizeTimeout] The timeout for allocation of
   * compute nodes to the pool. The default value is 15 minutes. Timeout values
   * use ISO 8601 format. For example, use PT10M for 10 minutes. The minimum
   * value is 5 minutes. If you specify a value less than 5 minutes, the Batch
   * service rejects the request with an error; if you are calling the REST API
   * directly, the HTTP status code is 400 (Bad Request).
   * @property {number} [targetDedicatedNodes] The desired number of dedicated
   * compute nodes in the pool. At least one of targetDedicatedNodes,
   * targetLowPriorityNodes must be set.
   * @property {number} [targetLowPriorityNodes] The desired number of
   * low-priority compute nodes in the pool. At least one of
   * targetDedicatedNodes, targetLowPriorityNodes must be set.
   * @property {string} [nodeDeallocationOption] Determines what to do with a
   * node and its running task(s) if the pool size is decreasing. If omitted,
   * the default value is Requeue. Possible values include: 'Requeue',
   * 'Terminate', 'TaskCompletion', 'RetainedData'
   */
  constructor() {
  }

  /**
   * Defines the metadata of FixedScaleSettings
   *
   * @returns {object} metadata of FixedScaleSettings
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'FixedScaleSettings',
      type: {
        name: 'Composite',
        className: 'FixedScaleSettings',
        modelProperties: {
          resizeTimeout: {
            required: false,
            serializedName: 'resizeTimeout',
            type: {
              name: 'TimeSpan'
            }
          },
          targetDedicatedNodes: {
            required: false,
            serializedName: 'targetDedicatedNodes',
            type: {
              name: 'Number'
            }
          },
          targetLowPriorityNodes: {
            required: false,
            serializedName: 'targetLowPriorityNodes',
            type: {
              name: 'Number'
            }
          },
          nodeDeallocationOption: {
            required: false,
            serializedName: 'nodeDeallocationOption',
            type: {
              name: 'Enum',
              allowedValues: [ 'Requeue', 'Terminate', 'TaskCompletion', 'RetainedData' ]
            }
          }
        }
      }
    };
  }
}

module.exports = FixedScaleSettings;
