/*
 * 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';

/**
 * Information about the execution of a job.
 *
 */
class JobPropertiesExecutionInfo {
  /**
   * Create a JobPropertiesExecutionInfo.
   * @member {date} [startTime] Start time. The time at which the job started
   * running. 'Running' corresponds to the running state. If the job has been
   * restarted or retried, this is the most recent time at which the job
   * started running. This property is present only for job that are in the
   * running or completed state.
   * @member {date} [endTime] End time. The time at which the job completed.
   * This property is only returned if the job is in completed state.
   * @member {number} [exitCode] Exit code. The exit code of the job. This
   * property is only returned if the job is in completed state.
   * @member {array} [errors] Errors. A collection of errors encountered by the
   * service during job execution.
   */
  constructor() {
  }

  /**
   * Defines the metadata of JobPropertiesExecutionInfo
   *
   * @returns {object} metadata of JobPropertiesExecutionInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'JobProperties_executionInfo',
      type: {
        name: 'Composite',
        className: 'JobPropertiesExecutionInfo',
        modelProperties: {
          startTime: {
            required: false,
            readOnly: true,
            serializedName: 'startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            readOnly: true,
            serializedName: 'endTime',
            type: {
              name: 'DateTime'
            }
          },
          exitCode: {
            required: false,
            readOnly: true,
            serializedName: 'exitCode',
            type: {
              name: 'Number'
            }
          },
          errors: {
            required: false,
            readOnly: true,
            serializedName: 'errors',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'BatchAIErrorElementType',
                  type: {
                    name: 'Composite',
                    className: 'BatchAIError'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = JobPropertiesExecutionInfo;
