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

var util = require('util');

/**
 * @class
 * Initializes a new instance of the PoolSpecification class.
 * @constructor
 * Specification for creating a new pool.
 * @member {string} [displayName] The display name for the pool.
 * 
 * @member {string} [vmSize] The size of the virtual machines in the pool. All
 * virtual machines in a pool are the same size.
 * 
 * @member {object} [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} [cloudServiceConfiguration.osFamily] The Azure Guest OS
 * family to be installed on the virtual machines in the pool.
 * 
 * @member {string} [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} [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} [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} [virtualMachineConfiguration.imageReference] A reference
 * to the Azure Virtual Machines Marketplace image to use.
 * 
 * @member {string} [virtualMachineConfiguration.imageReference.publisher] The
 * publisher of the Azure Virtual Machines Marketplace image. For example,
 * Canonical or MicrosoftWindowsServer.
 * 
 * @member {string} [virtualMachineConfiguration.imageReference.offer] The
 * offer type of the Azure Virtual Machines Marketplace image. For example,
 * UbuntuServer or WindowsServer.
 * 
 * @member {string} [virtualMachineConfiguration.imageReference.sku] The SKU
 * of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS
 * or 2012-R2-Datacenter.
 * 
 * @member {string} [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} [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} [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}
 * [virtualMachineConfiguration.windowsConfiguration.enableAutomaticUpdates]
 * Whether automatic updates are enabled on the virtual machine. If omitted,
 * the default value is true.
 * 
 * @member {number} [maxTasksPerNode] The maximum number of tasks that can run
 * concurrently on a single compute node in the pool.
 * 
 * @member {object} [taskSchedulingPolicy] How tasks are distributed among
 * compute nodes in the pool.
 * 
 * @member {string} [taskSchedulingPolicy.nodeFillType] How tasks should be
 * distributed across compute nodes. Possible values include: 'spread',
 * 'pack', 'unmapped'
 * 
 * @member {moment.duration} [resizeTimeout] The timeout for allocation of
 * compute nodes to the pool.
 * 
 * @member {number} [targetDedicated] The desired number of compute nodes in
 * the pool.
 * 
 * @member {boolean} [enableAutoScale] Whether the pool size should
 * automatically adjust over time.
 * 
 * @member {string} [autoScaleFormula] The formula for the desired number of
 * compute nodes in the pool.
 * 
 * @member {moment.duration} [autoScaleEvaluationInterval] A time interval for
 * the desired AutoScale evaluation period in the pool.
 * 
 * @member {boolean} [enableInterNodeCommunication] Whether the pool permits
 * direct communication between nodes.
 * 
 * @member {object} [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} [startTask.commandLine] The command line of the start task.
 * 
 * @member {array} [startTask.resourceFiles] A list of files that the Batch
 * service will download to the compute node before running the command line.
 * 
 * @member {array} [startTask.environmentSettings] A list of environment
 * variable settings for the start task.
 * 
 * @member {boolean} [startTask.runElevated] Whether to run the start task in
 * elevated mode. The default value is false.
 * 
 * @member {number} [startTask.maxTaskRetryCount] The maximum number of times
 * the task may be retried.
 * 
 * @member {boolean} [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} [certificateReferences] A list of certificates to be
 * installed on each compute node in the pool.
 * 
 * @member {array} [applicationPackageReferences] The list of application
 * packages to be installed on each compute node in the pool.
 * 
 * @member {array} [metadata] A list of name-value pairs associated with the
 * pool as metadata.
 * 
 */
function PoolSpecification() {
}

/**
 * Defines the metadata of PoolSpecification
 *
 * @returns {object} metadata of PoolSpecification
 *
 */
PoolSpecification.prototype.mapper = function () {
  return {
    required: false,
    serializedName: 'PoolSpecification',
    type: {
      name: 'Composite',
      className: 'PoolSpecification',
      modelProperties: {
        displayName: {
          required: false,
          serializedName: 'displayName',
          type: {
            name: 'String'
          }
        },
        vmSize: {
          required: false,
          serializedName: 'vmSize',
          type: {
            name: 'String'
          }
        },
        cloudServiceConfiguration: {
          required: false,
          serializedName: 'cloudServiceConfiguration',
          type: {
            name: 'Composite',
            className: 'CloudServiceConfiguration'
          }
        },
        virtualMachineConfiguration: {
          required: false,
          serializedName: 'virtualMachineConfiguration',
          type: {
            name: 'Composite',
            className: 'VirtualMachineConfiguration'
          }
        },
        maxTasksPerNode: {
          required: false,
          serializedName: 'maxTasksPerNode',
          type: {
            name: 'Number'
          }
        },
        taskSchedulingPolicy: {
          required: false,
          serializedName: 'taskSchedulingPolicy',
          type: {
            name: 'Composite',
            className: 'TaskSchedulingPolicy'
          }
        },
        resizeTimeout: {
          required: false,
          serializedName: 'resizeTimeout',
          type: {
            name: 'TimeSpan'
          }
        },
        targetDedicated: {
          required: false,
          serializedName: 'targetDedicated',
          type: {
            name: 'Number'
          }
        },
        enableAutoScale: {
          required: false,
          serializedName: 'enableAutoScale',
          type: {
            name: 'Boolean'
          }
        },
        autoScaleFormula: {
          required: false,
          serializedName: 'autoScaleFormula',
          type: {
            name: 'String'
          }
        },
        autoScaleEvaluationInterval: {
          required: false,
          serializedName: 'autoScaleEvaluationInterval',
          type: {
            name: 'TimeSpan'
          }
        },
        enableInterNodeCommunication: {
          required: false,
          serializedName: 'enableInterNodeCommunication',
          type: {
            name: 'Boolean'
          }
        },
        startTask: {
          required: false,
          serializedName: 'startTask',
          type: {
            name: 'Composite',
            className: 'StartTask'
          }
        },
        certificateReferences: {
          required: false,
          serializedName: 'certificateReferences',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serializedName: 'CertificateReferenceElementType',
                type: {
                  name: 'Composite',
                  className: 'CertificateReference'
                }
            }
          }
        },
        applicationPackageReferences: {
          required: false,
          serializedName: 'applicationPackageReferences',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serializedName: 'ApplicationPackageReferenceElementType',
                type: {
                  name: 'Composite',
                  className: 'ApplicationPackageReference'
                }
            }
          }
        },
        metadata: {
          required: false,
          serializedName: 'metadata',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serializedName: 'MetadataItemElementType',
                type: {
                  name: 'Composite',
                  className: 'MetadataItem'
                }
            }
          }
        }
      }
    }
  };
};

module.exports = PoolSpecification;
