/*
 * 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 TaskExecutionInformation class.
 * @constructor
 * Information about the execution of a task.
 * @member {date} [startTime] The time at which the task started running. If
 * the task has been restarted or retried, this is the most recent time at
 * which the task started running.
 * 
 * @member {date} [endTime] The time at which the task completed. This
 * property is set only if the task is in the Completed state.
 * 
 * @member {number} [exitCode] The exit code of the task. This property is set
 * only if the task is in completed state.
 * 
 * @member {object} [schedulingError] Details of any error encountered
 * scheduling 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.
 * 
 * @member {number} retryCount The number of times the task has been retried
 * by the Batch service.
 * 
 * @member {date} [lastRetryTime] The most recent time at which a retry of the
 * task started running.
 * 
 * @member {number} requeueCount The number of times the task has been
 * requeued by the Batch service as the result of a user request.
 * 
 * @member {date} [lastRequeueTime] The most recent time at which the task has
 * been requeued by the Batch service as the result of a user request.
 * 
 */
function TaskExecutionInformation() {
}

/**
 * Defines the metadata of TaskExecutionInformation
 *
 * @returns {object} metadata of TaskExecutionInformation
 *
 */
TaskExecutionInformation.prototype.mapper = function () {
  return {
    required: false,
    serializedName: 'TaskExecutionInformation',
    type: {
      name: 'Composite',
      className: 'TaskExecutionInformation',
      modelProperties: {
        startTime: {
          required: false,
          serializedName: 'startTime',
          type: {
            name: 'DateTime'
          }
        },
        endTime: {
          required: false,
          serializedName: 'endTime',
          type: {
            name: 'DateTime'
          }
        },
        exitCode: {
          required: false,
          serializedName: 'exitCode',
          type: {
            name: 'Number'
          }
        },
        schedulingError: {
          required: false,
          serializedName: 'schedulingError',
          type: {
            name: 'Composite',
            className: 'TaskSchedulingError'
          }
        },
        retryCount: {
          required: true,
          serializedName: 'retryCount',
          type: {
            name: 'Number'
          }
        },
        lastRetryTime: {
          required: false,
          serializedName: 'lastRetryTime',
          type: {
            name: 'DateTime'
          }
        },
        requeueCount: {
          required: true,
          serializedName: 'requeueCount',
          type: {
            name: 'Number'
          }
        },
        lastRequeueTime: {
          required: false,
          serializedName: 'lastRequeueTime',
          type: {
            name: 'DateTime'
          }
        }
      }
    }
  };
};

module.exports = TaskExecutionInformation;
