/*
 * 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 JobScheduleUpdateParameter class.
 * @constructor
 * Parameters for a CloudJobScheduleOperations.Update request.
 * @member {object} schedule The schedule according to which jobs will be
 * created. If you do not specify this element, it is equivalent to passing
 * the default schedule: that is, a single job scheduled to run immediately.
 * 
 * @member {date} [schedule.doNotRunUntil] The earliest time at which any job
 * may be created under this job schedule. If you do not specify a
 * doNotRunUntil time, the schedule becomes ready to create jobs immediately.
 * 
 * @member {date} [schedule.doNotRunAfter] A time after which no job will be
 * created under this job schedule. The schedule will move to the completed
 * state as soon as this deadline is past and there is no active job under
 * this job schedule.
 * 
 * @member {moment.duration} [schedule.startWindow] The time interval,
 * starting from the time at which the schedule indicates a job should be
 * created, within which a job must be created. If a job is not created
 * within the startWindow interval, then the 'opportunity' is lost; no job
 * will be created until the next recurrence of the schedule.
 * 
 * @member {moment.duration} [schedule.recurrenceInterval] The time interval
 * between the start times of two successive jobs under the job schedule. A
 * job schedule can have at most one active job under it at any given time.
 * 
 * @member {object} jobSpecification Details of the jobs to be created on this
 * schedule.
 * 
 * @member {number} [jobSpecification.priority] The priority of jobs created
 * under this schedule. Priority values can range from -1000 to 1000, with
 * -1000 being the lowest priority and 1000 being the highest priority. The
 * default value is 0.
 * 
 * @member {string} [jobSpecification.displayName] The display name for jobs
 * created under this schedule. It need not be unique and can contain any
 * Unicode characters up to a maximum length of 1024.
 * 
 * @member {boolean} [jobSpecification.usesTaskDependencies] The flag that
 * determines if this job will use tasks with dependencies.
 * 
 * @member {object} [jobSpecification.constraints] The execution constraints
 * for jobs created under this schedule.
 * 
 * @member {moment.duration} [jobSpecification.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} [jobSpecification.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} [jobSpecification.jobManagerTask] The details of a Job
 * Manager task to be launched when a job is started under this schedule.
 * 
 * @member {string} [jobSpecification.jobManagerTask.id] A string that
 * uniquely identifies the Job Manager task. A GUID is recommended.
 * 
 * @member {string} [jobSpecification.jobManagerTask.displayName] The display
 * name of the Job Manager task.
 * 
 * @member {string} [jobSpecification.jobManagerTask.commandLine] The command
 * line of the Job Manager task.
 * 
 * @member {array} [jobSpecification.jobManagerTask.resourceFiles] A list of
 * files that the Batch service will download to the compute node before
 * running the command line.
 * 
 * @member {array} [jobSpecification.jobManagerTask.environmentSettings] A
 * list of environment variable settings for the Job Manager task.
 * 
 * @member {object} [jobSpecification.jobManagerTask.constraints] Constraints
 * that apply to the Job Manager task.
 * 
 * @member {moment.duration}
 * [jobSpecification.jobManagerTask.constraints.maxWallClockTime] The maximum
 * elapsed time that the task may run, measured from the time the task
 * starts. If the task does not complete within the time limit, the Batch
 * service terminates it.
 * 
 * @member {moment.duration}
 * [jobSpecification.jobManagerTask.constraints.retentionTime] The minimum
 * time to retain the working directory for the task on the compute node
 * where it ran, from the time it completes execution. After this time, the
 * Batch service may delete the working directory and all its contents. The
 * default is infinite.
 * 
 * @member {number}
 * [jobSpecification.jobManagerTask.constraints.maxTaskRetryCount] The
 * maximum number of times the task may be retried. The Batch service retries
 * a task if its exit code is nonzero.
 * 
 * @member {boolean} [jobSpecification.jobManagerTask.killJobOnCompletion]
 * Whether completion of the Job Manager task signifies completion of the
 * entire job.
 * 
 * @member {boolean} [jobSpecification.jobManagerTask.runElevated] Whether to
 * run the Job Manager task in elevated mode. The default value is false.
 * 
 * @member {boolean} [jobSpecification.jobManagerTask.runExclusive] Whether
 * the Job Manager task requires exclusive use of the compute node where it
 * runs. If true, no other tasks will run on the same compute node for as
 * long as the Job Manager is running. If false, other tasks can run
 * simultaneously with the Job Manager on a compute node. (The Job Manager
 * task counts normally against the node’s concurrent task limit, so this is
 * only relevant if the node allows multiple concurrent tasks.)
 * 
 * @member {object} [jobSpecification.jobPreparationTask] The Job Preparation
 * task for jobs created under this schedule.
 * 
 * @member {string} [jobSpecification.jobPreparationTask.id] A string that
 * uniquely identifies the job preparation task within the job. The id can
 * contain any combination of alphanumeric characters including hyphens and
 * underscores and cannot contain more than 64 characters.
 * 
 * @member {string} [jobSpecification.jobPreparationTask.commandLine] The
 * command line of the Job Preparation task.
 * 
 * @member {array} [jobSpecification.jobPreparationTask.resourceFiles] A list
 * of files that the Batch service will download to the compute node before
 * running the command line.
 * 
 * @member {array} [jobSpecification.jobPreparationTask.environmentSettings] A
 * list of environment variable settings for the Job Preparation task.
 * 
 * @member {object} [jobSpecification.jobPreparationTask.constraints]
 * Constraints that apply to the Job Preparation task.
 * 
 * @member {moment.duration}
 * [jobSpecification.jobPreparationTask.constraints.maxWallClockTime] The
 * maximum elapsed time that the task may run, measured from the time the
 * task starts. If the task does not complete within the time limit, the
 * Batch service terminates it.
 * 
 * @member {moment.duration}
 * [jobSpecification.jobPreparationTask.constraints.retentionTime] The
 * minimum time to retain the working directory for the task on the compute
 * node where it ran, from the time it completes execution. After this time,
 * the Batch service may delete the working directory and all its contents.
 * The default is infinite.
 * 
 * @member {number}
 * [jobSpecification.jobPreparationTask.constraints.maxTaskRetryCount] The
 * maximum number of times the task may be retried. The Batch service retries
 * a task if its exit code is nonzero.
 * 
 * @member {boolean} [jobSpecification.jobPreparationTask.waitForSuccess]
 * Whether the Batch service should wait for the Job Preparation task to
 * complete successfully before scheduling any other tasks of the job on the
 * compute node.
 * 
 * @member {boolean} [jobSpecification.jobPreparationTask.runElevated] Whether
 * to run the Job Preparation task in elevated mode. The default value is
 * false.
 * 
 * @member {boolean}
 * [jobSpecification.jobPreparationTask.rerunOnNodeRebootAfterSuccess]
 * Whether the Batch service should rerun the Job Preparation task after a
 * compute node reboots. Note that the Job Preparation task should still be
 * written to be idempotent because it can be rerun if the compute node is
 * rebooted while Job Preparation task is still running. The default value is
 * true.
 * 
 * @member {object} [jobSpecification.jobReleaseTask] The Job Release task for
 * jobs created under this schedule.
 * 
 * @member {string} [jobSpecification.jobReleaseTask.id] A string that
 * uniquely identifies the Job Release task within the job. The id can
 * contain any combination of alphanumeric characters including hyphens and
 * underscores and cannot contain more than 64 characters.
 * 
 * @member {string} [jobSpecification.jobReleaseTask.commandLine] The command
 * line of the Job Release task.
 * 
 * @member {array} [jobSpecification.jobReleaseTask.resourceFiles] A list of
 * files that the Batch service will download to the compute node before
 * running the command line.
 * 
 * @member {array} [jobSpecification.jobReleaseTask.environmentSettings] A
 * list of environment variable settings for the Job Release task.
 * 
 * @member {moment.duration}
 * [jobSpecification.jobReleaseTask.maxWallClockTime] The maximum elapsed
 * time that the Job Release task may run on a given compute node, measured
 * from the time the task starts. If the task does not complete within the
 * time limit, the Batch service terminates it. The default value is 15
 * minutes.
 * 
 * @member {moment.duration} [jobSpecification.jobReleaseTask.retentionTime]
 * The minimum time to retain the working directory for the Job Release task
 * on the compute node. After this time, the Batch service may delete the
 * working directory and all its contents. The default is infinite.
 * 
 * @member {boolean} [jobSpecification.jobReleaseTask.runElevated] Whether to
 * run the Job Release task in elevated mode. The default value is false.
 * 
 * @member {array} [jobSpecification.commonEnvironmentSettings] A list of
 * common environment variable settings. These environment variables are set
 * for all tasks in jobs created under this schedule (including the Job
 * Manager, Job Preparation and Job Release tasks).
 * 
 * @member {object} [jobSpecification.poolInfo] The pool on which the Batch
 * service runs the tasks of jobs created under this schedule.
 * 
 * @member {string} [jobSpecification.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} [jobSpecification.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}
 * [jobSpecification.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}
 * [jobSpecification.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}
 * [jobSpecification.poolInfo.autoPoolSpecification.keepAlive] Whether to
 * keep an auto pool alive after its lifetime expires.
 * 
 * @member {object} [jobSpecification.poolInfo.autoPoolSpecification.pool] The
 * pool specification for the auto pool.
 * 
 * @member {string}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.displayName] The
 * display name for the pool.
 * 
 * @member {string}
 * [jobSpecification.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}
 * [jobSpecification.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}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.cloudServiceConfiguration.osFamily]
 * The Azure Guest OS family to be installed on the virtual machines in the
 * pool.
 * 
 * @member {string}
 * [jobSpecification.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}
 * [jobSpecification.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}
 * [jobSpecification.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}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.virtualMachineConfiguration.imageReference]
 * A reference to the Azure Virtual Machines Marketplace image to use.
 * 
 * @member {string}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.virtualMachineConfiguration.imageReference.publisher]
 * The publisher of the Azure Virtual Machines Marketplace image. For
 * example, Canonical or MicrosoftWindowsServer.
 * 
 * @member {string}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.virtualMachineConfiguration.imageReference.offer]
 * The offer type of the Azure Virtual Machines Marketplace image. For
 * example, UbuntuServer or WindowsServer.
 * 
 * @member {string}
 * [jobSpecification.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}
 * [jobSpecification.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}
 * [jobSpecification.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}
 * [jobSpecification.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}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.virtualMachineConfiguration.windowsConfiguration.enableAutomaticUpdates]
 * Whether automatic updates are enabled on the virtual machine. If omitted,
 * the default value is true.
 * 
 * @member {number}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.maxTasksPerNode] The
 * maximum number of tasks that can run concurrently on a single compute node
 * in the pool.
 * 
 * @member {object}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.taskSchedulingPolicy]
 * How tasks are distributed among compute nodes in the pool.
 * 
 * @member {string}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.taskSchedulingPolicy.nodeFillType]
 * How tasks should be distributed across compute nodes. Possible values
 * include: 'spread', 'pack', 'unmapped'
 * 
 * @member {moment.duration}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.resizeTimeout] The
 * timeout for allocation of compute nodes to the pool.
 * 
 * @member {number}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.targetDedicated] The
 * desired number of compute nodes in the pool.
 * 
 * @member {boolean}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.enableAutoScale]
 * Whether the pool size should automatically adjust over time.
 * 
 * @member {string}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.autoScaleFormula]
 * The formula for the desired number of compute nodes in the pool.
 * 
 * @member {moment.duration}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.autoScaleEvaluationInterval]
 * A time interval for the desired AutoScale evaluation period in the pool.
 * 
 * @member {boolean}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.enableInterNodeCommunication]
 * Whether the pool permits direct communication between nodes.
 * 
 * @member {object}
 * [jobSpecification.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}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.startTask.commandLine]
 * The command line of the start task.
 * 
 * @member {array}
 * [jobSpecification.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}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.startTask.environmentSettings]
 * A list of environment variable settings for the start task.
 * 
 * @member {boolean}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.startTask.runElevated]
 * Whether to run the start task in elevated mode. The default value is false.
 * 
 * @member {number}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.startTask.maxTaskRetryCount]
 * The maximum number of times the task may be retried.
 * 
 * @member {boolean}
 * [jobSpecification.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}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.certificateReferences]
 * A list of certificates to be installed on each compute node in the pool.
 * 
 * @member {array}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.applicationPackageReferences]
 * The list of application packages to be installed on each compute node in
 * the pool.
 * 
 * @member {array}
 * [jobSpecification.poolInfo.autoPoolSpecification.pool.metadata] A list of
 * name-value pairs associated with the pool as metadata.
 * 
 * @member {array} [jobSpecification.metadata] A list of name-value pairs
 * associated with each job created under this schedule as metadata.
 * 
 * @member {array} [metadata] A list of name-value pairs associated with the
 * job schedule as metadata. If you do not specify this element, it takes the
 * default value of an empty list; in effect, any existing metadata is
 * deleted.
 * 
 */
function JobScheduleUpdateParameter() {
}

/**
 * Defines the metadata of JobScheduleUpdateParameter
 *
 * @returns {object} metadata of JobScheduleUpdateParameter
 *
 */
JobScheduleUpdateParameter.prototype.mapper = function () {
  return {
    required: false,
    serializedName: 'JobScheduleUpdateParameter',
    type: {
      name: 'Composite',
      className: 'JobScheduleUpdateParameter',
      modelProperties: {
        schedule: {
          required: true,
          serializedName: 'schedule',
          type: {
            name: 'Composite',
            className: 'Schedule'
          }
        },
        jobSpecification: {
          required: true,
          serializedName: 'jobSpecification',
          type: {
            name: 'Composite',
            className: 'JobSpecification'
          }
        },
        metadata: {
          required: false,
          serializedName: 'metadata',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serializedName: 'MetadataItemElementType',
                type: {
                  name: 'Composite',
                  className: 'MetadataItem'
                }
            }
          }
        }
      }
    }
  };
};

module.exports = JobScheduleUpdateParameter;
