/*
 * 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 JobUpdateParameter class.
 * @constructor
 * Parameters for a CloudJobOperations.Update request.
 * @member {number} [priority] The priority of the job. Priority values can
 * range from -1000 to 1000, with -1000 being the lowest priority and 1000
 * being the highest priority. If omitted, the priority of the job is left
 * unchanged.
 * 
 * @member {object} [constraints] The execution constraints for the job. If
 * omitted, the existing execution constraints are left unchanged.
 * 
 * @member {moment.duration} [constraints.maxWallClockTime] The maximum
 * elapsed time that the job may run, measured from the time the job starts.
 * If the job does not complete within the time limit, the Batch service
 * terminates it and any tasks that are still running.
 * 
 * @member {number} [constraints.maxTaskRetryCount] The maximum number of
 * times each task may be retried. The Batch service retries a task if its
 * exit code is nonzero.
 * 
 * @member {object} poolInfo The pool on which the Batch service runs the
 * job's tasks. If omitted, the job continues to run on its current pool.
 * 
 * @member {string} [poolInfo.poolId] The id of an existing pool. All the
 * tasks of the job will run on the specified pool. You must specify either
 * PoolId or AutoPoolSpecification, but not both.
 * 
 * @member {object} [poolInfo.autoPoolSpecification] Characteristics for a
 * temporary 'auto pool'. The Batch service will create this auto pool and
 * run all of the tasks of the job on it, and will delete the pool once the
 * job has completed. You must specify either PoolId or
 * AutoPoolSpecification, but not both.
 * 
 * @member {string} [poolInfo.autoPoolSpecification.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} [poolInfo.autoPoolSpecification.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} [poolInfo.autoPoolSpecification.keepAlive] Whether to
 * keep an auto pool alive after its lifetime expires.
 * 
 * @member {object} [poolInfo.autoPoolSpecification.pool] The pool
 * specification for the auto pool.
 * 
 * @member {string} [poolInfo.autoPoolSpecification.pool.displayName] The
 * display name for the pool.
 * 
 * @member {string} [poolInfo.autoPoolSpecification.pool.vmSize] The size of
 * the virtual machines in the pool. All virtual machines in a pool are the
 * same size.
 * 
 * @member {object}
 * [poolInfo.autoPoolSpecification.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}
 * [poolInfo.autoPoolSpecification.pool.cloudServiceConfiguration.osFamily]
 * The Azure Guest OS family to be installed on the virtual machines in the
 * pool.
 * 
 * @member {string}
 * [poolInfo.autoPoolSpecification.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}
 * [poolInfo.autoPoolSpecification.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}
 * [poolInfo.autoPoolSpecification.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}
 * [poolInfo.autoPoolSpecification.pool.virtualMachineConfiguration.imageReference]
 * A reference to the Azure Virtual Machines Marketplace image to use.
 * 
 * @member {string}
 * [poolInfo.autoPoolSpecification.pool.virtualMachineConfiguration.imageReference.publisher]
 * The publisher of the Azure Virtual Machines Marketplace image. For
 * example, Canonical or MicrosoftWindowsServer.
 * 
 * @member {string}
 * [poolInfo.autoPoolSpecification.pool.virtualMachineConfiguration.imageReference.offer]
 * The offer type of the Azure Virtual Machines Marketplace image. For
 * example, UbuntuServer or WindowsServer.
 * 
 * @member {string}
 * [poolInfo.autoPoolSpecification.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}
 * [poolInfo.autoPoolSpecification.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}
 * [poolInfo.autoPoolSpecification.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}
 * [poolInfo.autoPoolSpecification.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}
 * [poolInfo.autoPoolSpecification.pool.virtualMachineConfiguration.windowsConfiguration.enableAutomaticUpdates]
 * Whether automatic updates are enabled on the virtual machine. If omitted,
 * the default value is true.
 * 
 * @member {number} [poolInfo.autoPoolSpecification.pool.maxTasksPerNode] The
 * maximum number of tasks that can run concurrently on a single compute node
 * in the pool.
 * 
 * @member {object} [poolInfo.autoPoolSpecification.pool.taskSchedulingPolicy]
 * How tasks are distributed among compute nodes in the pool.
 * 
 * @member {string}
 * [poolInfo.autoPoolSpecification.pool.taskSchedulingPolicy.nodeFillType]
 * How tasks should be distributed across compute nodes. Possible values
 * include: 'spread', 'pack', 'unmapped'
 * 
 * @member {moment.duration}
 * [poolInfo.autoPoolSpecification.pool.resizeTimeout] The timeout for
 * allocation of compute nodes to the pool.
 * 
 * @member {number} [poolInfo.autoPoolSpecification.pool.targetDedicated] The
 * desired number of compute nodes in the pool.
 * 
 * @member {boolean} [poolInfo.autoPoolSpecification.pool.enableAutoScale]
 * Whether the pool size should automatically adjust over time.
 * 
 * @member {string} [poolInfo.autoPoolSpecification.pool.autoScaleFormula] The
 * formula for the desired number of compute nodes in the pool.
 * 
 * @member {moment.duration}
 * [poolInfo.autoPoolSpecification.pool.autoScaleEvaluationInterval] A time
 * interval for the desired AutoScale evaluation period in the pool.
 * 
 * @member {boolean}
 * [poolInfo.autoPoolSpecification.pool.enableInterNodeCommunication] Whether
 * the pool permits direct communication between nodes.
 * 
 * @member {object} [poolInfo.autoPoolSpecification.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}
 * [poolInfo.autoPoolSpecification.pool.startTask.commandLine] The command
 * line of the start task.
 * 
 * @member {array}
 * [poolInfo.autoPoolSpecification.pool.startTask.resourceFiles] A list of
 * files that the Batch service will download to the compute node before
 * running the command line.
 * 
 * @member {array}
 * [poolInfo.autoPoolSpecification.pool.startTask.environmentSettings] A list
 * of environment variable settings for the start task.
 * 
 * @member {boolean}
 * [poolInfo.autoPoolSpecification.pool.startTask.runElevated] Whether to run
 * the start task in elevated mode. The default value is false.
 * 
 * @member {number}
 * [poolInfo.autoPoolSpecification.pool.startTask.maxTaskRetryCount] The
 * maximum number of times the task may be retried.
 * 
 * @member {boolean}
 * [poolInfo.autoPoolSpecification.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} [poolInfo.autoPoolSpecification.pool.certificateReferences]
 * A list of certificates to be installed on each compute node in the pool.
 * 
 * @member {array}
 * [poolInfo.autoPoolSpecification.pool.applicationPackageReferences] The
 * list of application packages to be installed on each compute node in the
 * pool.
 * 
 * @member {array} [poolInfo.autoPoolSpecification.pool.metadata] A list of
 * name-value pairs associated with the pool as metadata.
 * 
 * @member {array} [metadata] A list of name-value pairs associated with the
 * job as metadata. If omitted, the existing job metadata is left unchanged.
 * 
 */
function JobUpdateParameter() {
}

/**
 * Defines the metadata of JobUpdateParameter
 *
 * @returns {object} metadata of JobUpdateParameter
 *
 */
JobUpdateParameter.prototype.mapper = function () {
  return {
    required: false,
    serializedName: 'JobUpdateParameter',
    type: {
      name: 'Composite',
      className: 'JobUpdateParameter',
      modelProperties: {
        priority: {
          required: false,
          serializedName: 'priority',
          type: {
            name: 'Number'
          }
        },
        constraints: {
          required: false,
          serializedName: 'constraints',
          type: {
            name: 'Composite',
            className: 'JobConstraints'
          }
        },
        poolInfo: {
          required: true,
          serializedName: 'poolInfo',
          type: {
            name: 'Composite',
            className: 'PoolInformation'
          }
        },
        metadata: {
          required: false,
          serializedName: 'metadata',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serializedName: 'MetadataItemElementType',
                type: {
                  name: 'Composite',
                  className: 'MetadataItem'
                }
            }
          }
        }
      }
    }
  };
};

module.exports = JobUpdateParameter;
