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

var models = require('./index');

/**
 * @class
 * Initializes a new instance of the AutoPoolSpecification class.
 * @constructor
 * Specifies characteristics for a temporary 'auto pool'. The Batch service
 * will create this auto pool, run all the tasks for the job on it, and will
 * delete the pool once the job has completed.
 * @member {string} [autoPoolIdPrefix] A prefix to be added to the unique
 * identifier when a pool is automatically created. The prefix can be up to
 * 20 characters long.
 * 
 * @member {string} poolLifetimeOption The minimum lifetime of created auto
 * pools, and how multiple jobs on a schedule are assigned to pools. Possible
 * values include: 'jobschedule', 'job', 'unmapped'
 * 
 * @member {boolean} [keepAlive] Whether to keep an auto pool alive after its
 * lifetime expires.
 * 
 * @member {object} [pool] The pool specification for the auto pool.
 * 
 * @member {string} [pool.displayName] The display name for the pool.
 * 
 * @member {string} [pool.vmSize] The size of the virtual machines in the
 * pool. All virtual machines in a pool are the same size.
 * 
 * @member {object} [pool.cloudServiceConfiguration] The cloud service
 * configuration for the pool. This property and VirtualMachineConfiguration
 * are mutually exclusive and one of the properties must be specified.
 * 
 * @member {string} [pool.cloudServiceConfiguration.osFamily] The Azure Guest
 * OS family to be installed on the virtual machines in the pool.
 * 
 * @member {string} [pool.cloudServiceConfiguration.targetOSVersion] The Azure
 * Guest OS version to be installed on the virtual machines in the pool. The
 * default value is * which specifies the latest operating system version for
 * the specified OS family.
 * 
 * @member {string} [pool.cloudServiceConfiguration.currentOSVersion] The
 * Azure Guest OS Version currently installed on the virtual machines in the
 * pool. This may differ from TargetOSVersion if the pool state is Upgrading.
 * 
 * @member {object} [pool.virtualMachineConfiguration] The virtual machine
 * configuration for the pool. This property and CloudServiceConfiguration
 * are mutually exclusive and one of the properties must be specified.
 * 
 * @member {object} [pool.virtualMachineConfiguration.imageReference] A
 * reference to the Azure Virtual Machines Marketplace image to use.
 * 
 * @member {string}
 * [pool.virtualMachineConfiguration.imageReference.publisher] The publisher
 * of the Azure Virtual Machines Marketplace image. For example, Canonical or
 * MicrosoftWindowsServer.
 * 
 * @member {string} [pool.virtualMachineConfiguration.imageReference.offer]
 * The offer type of the Azure Virtual Machines Marketplace image. For
 * example, UbuntuServer or WindowsServer.
 * 
 * @member {string} [pool.virtualMachineConfiguration.imageReference.sku] The
 * SKU of the Azure Virtual Machines Marketplace image. For example,
 * 14.04.0-LTS or 2012-R2-Datacenter.
 * 
 * @member {string} [pool.virtualMachineConfiguration.imageReference.version]
 * The version of the Azure Virtual Machines Marketplace image. A value of
 * 'latest' can be specified to select the latest version of an image. If
 * omitted, the default is 'latest'.
 * 
 * @member {string} [pool.virtualMachineConfiguration.nodeAgentSKUId] The SKU
 * of Batch Node Agent to be provisioned on the compute node. The Batch node
 * agent is a program that runs on each node in the pool, and provides the
 * command-and-control interface between the node and the Batch service.
 * There are different implementations of the node agent, known as SKUs, for
 * different operating systems.
 * 
 * @member {object} [pool.virtualMachineConfiguration.windowsConfiguration]
 * Windows operating system settings on the virtual machine. This property
 * must not be specified if the ImageReference property specifies a Linux OS
 * image.
 * 
 * @member {boolean}
 * [pool.virtualMachineConfiguration.windowsConfiguration.enableAutomaticUpdates]
 * Whether automatic updates are enabled on the virtual machine. If omitted,
 * the default value is true.
 * 
 * @member {number} [pool.maxTasksPerNode] The maximum number of tasks that
 * can run concurrently on a single compute node in the pool.
 * 
 * @member {object} [pool.taskSchedulingPolicy] How tasks are distributed
 * among compute nodes in the pool.
 * 
 * @member {string} [pool.taskSchedulingPolicy.nodeFillType] How tasks should
 * be distributed across compute nodes. Possible values include: 'spread',
 * 'pack', 'unmapped'
 * 
 * @member {moment.duration} [pool.resizeTimeout] The timeout for allocation
 * of compute nodes to the pool.
 * 
 * @member {number} [pool.targetDedicated] The desired number of compute nodes
 * in the pool.
 * 
 * @member {boolean} [pool.enableAutoScale] Whether the pool size should
 * automatically adjust over time.
 * 
 * @member {string} [pool.autoScaleFormula] The formula for the desired number
 * of compute nodes in the pool.
 * 
 * @member {moment.duration} [pool.autoScaleEvaluationInterval] A time
 * interval for the desired AutoScale evaluation period in the pool.
 * 
 * @member {boolean} [pool.enableInterNodeCommunication] Whether the pool
 * permits direct communication between nodes.
 * 
 * @member {object} [pool.startTask] A task to run on each compute node as it
 * joins the pool. The task runs when the node is added to the pool or when
 * the node is restarted.
 * 
 * @member {string} [pool.startTask.commandLine] The command line of the start
 * task.
 * 
 * @member {array} [pool.startTask.resourceFiles] A list of files that the
 * Batch service will download to the compute node before running the command
 * line.
 * 
 * @member {array} [pool.startTask.environmentSettings] A list of environment
 * variable settings for the start task.
 * 
 * @member {boolean} [pool.startTask.runElevated] Whether to run the start
 * task in elevated mode. The default value is false.
 * 
 * @member {number} [pool.startTask.maxTaskRetryCount] The maximum number of
 * times the task may be retried.
 * 
 * @member {boolean} [pool.startTask.waitForSuccess] Whether the Batch service
 * should wait for the start task to complete successfully (that is, to exit
 * with exit code 0) before scheduling any tasks on the compute node.
 * 
 * @member {array} [pool.certificateReferences] A list of certificates to be
 * installed on each compute node in the pool.
 * 
 * @member {array} [pool.applicationPackageReferences] The list of application
 * packages to be installed on each compute node in the pool.
 * 
 * @member {array} [pool.metadata] A list of name-value pairs associated with
 * the pool as metadata.
 * 
 */
function AutoPoolSpecification() {
}

/**
 * Defines the metadata of AutoPoolSpecification
 *
 * @returns {object} metadata of AutoPoolSpecification
 *
 */
AutoPoolSpecification.prototype.mapper = function () {
  return {
    required: false,
    serializedName: 'AutoPoolSpecification',
    type: {
      name: 'Composite',
      className: 'AutoPoolSpecification',
      modelProperties: {
        autoPoolIdPrefix: {
          required: false,
          serializedName: 'autoPoolIdPrefix',
          type: {
            name: 'String'
          }
        },
        poolLifetimeOption: {
          required: true,
          serializedName: 'poolLifetimeOption',
          type: {
            name: 'Enum',
            allowedValues: [ 'jobschedule', 'job', 'unmapped' ]
          }
        },
        keepAlive: {
          required: false,
          serializedName: 'keepAlive',
          type: {
            name: 'Boolean'
          }
        },
        pool: {
          required: false,
          serializedName: 'pool',
          type: {
            name: 'Composite',
            className: 'PoolSpecification'
          }
        }
      }
    }
  };
};

module.exports = AutoPoolSpecification;
