/*
 * 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 JobReleaseTaskExecutionInformation class.
 * @constructor
 * Contains information about the execution of a Job Release task on a compute
 * node.
 * @member {date} startTime The time at which the task started running. Note
 * that every time the task is restarted, this value is updated.
 * 
 * @member {date} [endTime] The time at which the Job Release task completed.
 * This property is set only if the task is in the Completed state.
 * 
 * @member {string} state The current state of the Job Release task. Possible
 * values include: 'running', 'completed'
 * 
 * @member {string} [taskRootDirectory] The root directory of the Job Release
 * task on the compute node. You can use this path to retrieve files created
 * by the task, such as log files.
 * 
 * @member {string} [taskRootDirectoryUrl] The URL to the root directory of
 * the Job Release task on the compute node.
 * 
 * @member {number} [exitCode] The exit code of the Job Release task. This
 * property is set only if the task is in the Completed state.
 * 
 * @member {object} [schedulingError] The scheduling error encountered by the
 * Batch service when starting the task.
 * 
 * @member {string} [schedulingError.category] The category of the task
 * scheduling error. Possible values include: 'usererror', 'servererror',
 * 'unmapped'
 * 
 * @member {string} [schedulingError.code] An identifier for the task
 * scheduling error. Codes are invariant and are intended to be consumed
 * programmatically.
 * 
 * @member {string} [schedulingError.message] A message describing the task
 * scheduling error, intended to be suitable for display in a user interface.
 * 
 * @member {array} [schedulingError.details] The list of additional error
 * details related to the scheduling error.
 * 
 */
function JobReleaseTaskExecutionInformation() {
}

/**
 * Defines the metadata of JobReleaseTaskExecutionInformation
 *
 * @returns {object} metadata of JobReleaseTaskExecutionInformation
 *
 */
JobReleaseTaskExecutionInformation.prototype.mapper = function () {
  return {
    required: false,
    serializedName: 'JobReleaseTaskExecutionInformation',
    type: {
      name: 'Composite',
      className: 'JobReleaseTaskExecutionInformation',
      modelProperties: {
        startTime: {
          required: true,
          serializedName: 'startTime',
          type: {
            name: 'DateTime'
          }
        },
        endTime: {
          required: false,
          serializedName: 'endTime',
          type: {
            name: 'DateTime'
          }
        },
        state: {
          required: true,
          serializedName: 'state',
          type: {
            name: 'Enum',
            allowedValues: [ 'running', 'completed' ]
          }
        },
        taskRootDirectory: {
          required: false,
          serializedName: 'taskRootDirectory',
          type: {
            name: 'String'
          }
        },
        taskRootDirectoryUrl: {
          required: false,
          serializedName: 'taskRootDirectoryUrl',
          type: {
            name: 'String'
          }
        },
        exitCode: {
          required: false,
          serializedName: 'exitCode',
          type: {
            name: 'Number'
          }
        },
        schedulingError: {
          required: false,
          serializedName: 'schedulingError',
          type: {
            name: 'Composite',
            className: 'TaskSchedulingError'
          }
        }
      }
    }
  };
};

module.exports = JobReleaseTaskExecutionInformation;
