/*
 * 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 JobInformation class.
 * @constructor
 * The common Data Lake Analytics job information properties.
 *
 * @member {uuid} [jobId] the job's unique identifier (a GUID).
 * 
 * @member {string} name the friendly name of the job.
 * 
 * @member {string} type the job type of the current job (Hive or USql).
 * Possible values include: 'USql', 'Hive'
 * 
 * @member {string} [submitter] the user or account that submitted the job.
 * 
 * @member {array} [errorMessage] the error message details for the job, if
 * the job failed.
 * 
 * @member {number} [degreeOfParallelism] the degree of parallelism used for
 * this job. This must be greater than 0.
 * 
 * @member {number} [priority] the priority value for the current job. Lower
 * numbers have a higher priority. By default, a job has a priority of 1000.
 * This must be greater than 0.
 * 
 * @member {date} [submitTime] the time the job was submitted to the service.
 * 
 * @member {date} [startTime] the start time of the job.
 * 
 * @member {date} [endTime] the completion time of the job.
 * 
 * @member {string} [state] the job state. When the job is in the Ended state,
 * refer to Result and ErrorMessage for details. Possible values include:
 * 'Accepted', 'Compiling', 'Ended', 'New', 'Queued', 'Running',
 * 'Scheduling', 'Starting', 'Paused', 'WaitingForCapacity'
 * 
 * @member {string} [result] the result of job execution or the current result
 * of the running job. Possible values include: 'None', 'Succeeded',
 * 'Cancelled', 'Failed'
 * 
 * @member {string} [logFolder] the log folder path to use in the following
 * format:
 * adl://<accountName>.azuredatalakestore.net/system/jobservice/jobs/Usql/2016/03/13/17/18/5fe51957-93bc-4de0-8ddc-c5a4753b068b/logs/.
 * 
 * @member {array} [logFilePatterns] the list of log file name patterns to
 * find in the logFolder. '*' is the only matching character allowed. Example
 * format: jobExecution*.log or *mylog*.txt
 * 
 * @member {array} [stateAuditRecords] the job state audit records, indicating
 * when various operations have been performed on this job.
 * 
 * @member {object} properties the job specific properties.
 * 
 * @member {string} [properties.runtimeVersion] the runtime version of the
 * Data Lake Analytics engine to use for the specific type of job being run.
 * 
 * @member {string} [properties.script] the script to run
 * 
 * @member {string} [properties.type] Polymorhpic Discriminator
 * 
 */
function JobInformation() {
}

/**
 * Defines the metadata of JobInformation
 *
 * @returns {object} metadata of JobInformation
 *
 */
JobInformation.prototype.mapper = function () {
  return {
    required: false,
    serializedName: 'JobInformation',
    type: {
      name: 'Composite',
      className: 'JobInformation',
      modelProperties: {
        jobId: {
          required: false,
          serializedName: 'jobId',
          type: {
            name: 'String'
          }
        },
        name: {
          required: true,
          serializedName: 'name',
          type: {
            name: 'String'
          }
        },
        type: {
          required: true,
          serializedName: 'type',
          type: {
            name: 'Enum',
            allowedValues: [ 'USql', 'Hive' ]
          }
        },
        submitter: {
          required: false,
          serializedName: 'submitter',
          type: {
            name: 'String'
          }
        },
        errorMessage: {
          required: false,
          readOnly: true,
          serializedName: 'errorMessage',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serializedName: 'JobErrorDetailsElementType',
                type: {
                  name: 'Composite',
                  className: 'JobErrorDetails'
                }
            }
          }
        },
        degreeOfParallelism: {
          required: false,
          serializedName: 'degreeOfParallelism',
          type: {
            name: 'Number'
          }
        },
        priority: {
          required: false,
          serializedName: 'priority',
          type: {
            name: 'Number'
          }
        },
        submitTime: {
          required: false,
          readOnly: true,
          serializedName: 'submitTime',
          type: {
            name: 'DateTime'
          }
        },
        startTime: {
          required: false,
          readOnly: true,
          serializedName: 'startTime',
          type: {
            name: 'DateTime'
          }
        },
        endTime: {
          required: false,
          readOnly: true,
          serializedName: 'endTime',
          type: {
            name: 'DateTime'
          }
        },
        state: {
          required: false,
          readOnly: true,
          serializedName: 'state',
          type: {
            name: 'Enum',
            allowedValues: [ 'Accepted', 'Compiling', 'Ended', 'New', 'Queued', 'Running', 'Scheduling', 'Starting', 'Paused', 'WaitingForCapacity' ]
          }
        },
        result: {
          required: false,
          readOnly: true,
          serializedName: 'result',
          type: {
            name: 'Enum',
            allowedValues: [ 'None', 'Succeeded', 'Cancelled', 'Failed' ]
          }
        },
        logFolder: {
          required: false,
          readOnly: true,
          serializedName: 'logFolder',
          type: {
            name: 'String'
          }
        },
        logFilePatterns: {
          required: false,
          serializedName: 'logFilePatterns',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serializedName: 'StringElementType',
                type: {
                  name: 'String'
                }
            }
          }
        },
        stateAuditRecords: {
          required: false,
          readOnly: true,
          serializedName: 'stateAuditRecords',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serializedName: 'JobStateAuditRecordElementType',
                type: {
                  name: 'Composite',
                  className: 'JobStateAuditRecord'
                }
            }
          }
        },
        properties: {
          required: true,
          serializedName: 'properties',
          type: {
            name: 'Composite',
            polymorphicDiscriminator: 'type',
            uberParent: 'JobProperties',
            className: 'JobProperties'
          }
        }
      }
    }
  };
};

module.exports = JobInformation;
