text: /*
   * 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 A Job Release task to run on job completion on any compute node
   * where the job has run.
    *
   * The Job Release task runs when the job ends, because of one of the
   * following: The user calls the Terminate Job API, or the Delete Job API while
   * the job is still active, the job's maximum wall clock time constraint is
   * reached, and the job is still active, or the job's Job Manager task
   * completed, and the job is configured to terminate when the Job Manager
   * completes. The Job Release task runs on each compute node where tasks of the
   * job have run and the Job Preparation task ran and completed. If you reimage
   * a compute node after it has run the Job Preparation task, and the job ends
   * without any further tasks of the job running on that compute node (and hence
   * the Job Preparation task does not re-run), then the Job Release task does
   * not run on that node. If a compute node reboots while the Job Release task
   * is still running, the Job Release task runs again when the compute node
   * starts up. The job is not marked as complete until all Job Release tasks
   * have completed. The Job Release task runs in the background. It does not
   * occupy a scheduling slot; that is, it does not count towards the
   * maxTasksPerNode limit specified on the pool.
   *
   */
  class JobReleaseTask {
    /**
     * Create a JobReleaseTask.
     * @member {string} [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. If you do not specify this property, the Batch service
     * assigns a default value of 'jobrelease'. No other task in the job can have
     * the same ID as the Job Release task. If you try to submit a task with the
     * same id, the Batch service rejects the request with error code
     * TaskIdSameAsJobReleaseTask; if you are calling the REST API directly, the
     * HTTP status code is 409 (Conflict).
     * @member {string} commandLine The command line of the Job Release task. The
     * command line does not run under a shell, and therefore cannot take
     * advantage of shell features such as environment variable expansion. If you
     * want to take advantage of such features, you should invoke the shell in
     * the command line, for example using "cmd /c MyCommand" in Windows or
     * "/bin/sh -c MyCommand" in Linux. If the command line refers to file paths,
     * it should use a relative path (relative to the task working directory), or
     * use the Batch provided environment variable
     * (https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables).
     * @member {object} [containerSettings] The settings for the container under
     * which the Job Release task runs. When this is specified, all directories
     * recursively below the AZ_BATCH_NODE_ROOT_DIR (the root of Azure Batch
     * directories on the node) are mapped into the container, all task
     * environment variables are mapped into the container, and the task command
     * line is executed in the container.
     * @member {string} [containerSettings.containerRunOptions] These additional
     * options are supplied as arguments to the "docker create" command, in
     * addition to those controlled by the Batch Service.
     * @member {string} [containerSettings.imageName] This is the full image
     * reference, as would be specified to "docker pull". If no tag is provided
     * as part of the image name, the tag ":latest" is used as a default.
     * @member {object} [containerSettings.registry] This setting can be omitted
     * if was already provided at pool creation.
     * @member {string} [containerSettings.registry.registryServer] If omitted,
     * the default is "docker.io".
     * @member {string} [containerSettings.registry.userName]
     * @member {string} [containerSettings.registry.password]
     * @member {array} [resourceFiles] A list of files that the Batch service
     * will download to the compute node before running the command line.  There
     * is a maximum size for the list of resource files.  When the max size is
     * exceeded, the request will fail and the response error code will be
     * RequestEntityTooLarge. If this occurs, the collection of ResourceFiles
     * must be reduced in size. This can be achieved using .zip files,
     * Application Packages, or Docker Containers. Files listed under this
     * element are located in the task's working directory.
     * @member {array} [environmentSettings] A list of environment variable
     * settings for the Job Release task.
     * @member {moment.duration} [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. You may
     * not specify a timeout longer than 15 minutes. If you do, the Batch service
     * rejects it with an error; if you are calling the REST API directly, the
     * HTTP status code is 400 (Bad Request).
     * @member {moment.duration} [retentionTime] The minimum time to retain the
     * task directory for the Job Release task on the compute node. After this
     * time, the Batch service may delete the task directory and all its
     * contents. The default is infinite, i.e. the task directory will be
     * retained until the compute node is removed or reimaged.
     * @member {object} [userIdentity] The user identity under which the Job
     * Release task runs. If omitted, the task runs as a non-administrative user
     * unique to the task.
     * @member {string} [userIdentity.userName] The userName and autoUser
     * properties are mutually exclusive; you must specify one but not both.
     * @member {object} [userIdentity.autoUser] The userName and autoUser
     * properties are mutually exclusive; you must specify one but not both.
     * @member {string} [userIdentity.autoUser.scope] The default value is task.
     * Possible values include: 'task', 'pool'
     * @member {string} [userIdentity.autoUser.elevationLevel] The default value
     * is nonAdmin. Possible values include: 'nonAdmin', 'admin'
     */
    constructor() {
    }
  
    /**
     * Defines the metadata of JobReleaseTask
     *
     * @returns {object} metadata of JobReleaseTask
     *
     */
    mapper() {
      return {
        required: false,
        serializedName: 'JobReleaseTask',
        type: {
          name: 'Composite',
          className: 'JobReleaseTask',
          modelProperties: {
            id: {
              required: false,
              serializedName: 'id',
              type: {
                name: 'String'
              }
            },
            commandLine: {
              required: true,
              serializedName: 'commandLine',
              type: {
                name: 'String'
              }
            },
            containerSettings: {
              required: false,
              serializedName: 'containerSettings',
              type: {
                name: 'Composite',
                className: 'TaskContainerSettings'
              }
            },
            resourceFiles: {
              required: false,
              serializedName: 'resourceFiles',
              type: {
                name: 'Sequence',
                element: {
                    required: false,
                    serializedName: 'ResourceFileElementType',
                    type: {
                      name: 'Composite',
                      className: 'ResourceFile'
                    }
                }
              }
            },
            environmentSettings: {
              required: false,
              serializedName: 'environmentSettings',
              type: {
                name: 'Sequence',
                element: {
                    required: false,
                    serializedName: 'EnvironmentSettingElementType',
                    type: {
                      name: 'Composite',
                      className: 'EnvironmentSetting'
                    }
                }
              }
            },
            maxWallClockTime: {
              required: false,
              serializedName: 'maxWallClockTime',
              type: {
                name: 'TimeSpan'
              }
            },
            retentionTime: {
              required: false,
              serializedName: 'retentionTime',
              type: {
                name: 'TimeSpan'
              }
            },
            userIdentity: {
              required: false,
              serializedName: 'userIdentity',
              type: {
                name: 'Composite',
                className: 'UserIdentity'
              }
            }
          }
        }
      };
    }
  }
  
  module.exports = JobReleaseTask;
  