/*
 * 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 Details about the current or last completed resize operation.
  *
 * Describes either the current operation (if the pool AllocationState is
 * Resizing) or the previously completed operation (if the AllocationState is
 * Steady).
 *
 */
class ResizeOperationStatus {
  /**
   * Create a ResizeOperationStatus.
   * @property {number} [targetDedicatedNodes] The desired number of dedicated
   * compute nodes in the pool.
   * @property {number} [targetLowPriorityNodes] The desired number of
   * low-priority compute nodes in the pool.
   * @property {moment.duration} [resizeTimeout] The timeout for allocation of
   * compute nodes to the pool or removal of compute nodes from the pool. The
   * default value is 15 minutes. The minimum value is 5 minutes. If you
   * specify a value less than 5 minutes, the Batch service returns an error;
   * if you are calling the REST API directly, the HTTP status code is 400 (Bad
   * Request).
   * @property {string} [nodeDeallocationOption] Determines what to do with a
   * node and its running task(s) if the pool size is decreasing. The default
   * value is requeue. Possible values include: 'Requeue', 'Terminate',
   * 'TaskCompletion', 'RetainedData'
   * @property {date} [startTime] The time when this resize operation was
   * started.
   * @property {array} [errors] Details of any errors encountered while
   * performing the last resize on the pool. This property is set only if an
   * error occurred during the last pool resize, and only when the pool
   * allocationState is Steady.
   */
  constructor() {
  }

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

module.exports = ResizeOperationStatus;
