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

const models = require('./index');

/**
 * The common Data Lake Analytics job information properties.
 *
 */
class JobInformationBasic {
  /**
   * Create a JobInformationBasic.
   * @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 {number} [degreeOfParallelism] the degree of parallelism used for
   * this job. This must be greater than 0, if set to less than 0 it will
   * default to 1. Default value: 1 .
   * @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 {object} [related] the recurring job relationship information
   * properties.
   * @member {uuid} [related.pipelineId] the job relationship pipeline
   * identifier (a GUID).
   * @member {string} [related.pipelineName] the friendly name of the job
   * relationship pipeline, which does not need to be unique.
   * @member {string} [related.pipelineUri] the pipeline uri, unique, links to
   * the originating service for this pipeline.
   * @member {uuid} [related.runId] the run identifier (a GUID), unique
   * identifier of the iteration of this pipeline.
   * @member {uuid} [related.recurrenceId] the recurrence identifier (a GUID),
   * unique per activity/script, regardless of iterations. This is something to
   * link different occurrences of the same job together.
   * @member {string} [related.recurrenceName] the recurrence name, user
   * friendly name for the correlation between jobs.
   */
  constructor() {
  }

  /**
   * Defines the metadata of JobInformationBasic
   *
   * @returns {object} metadata of JobInformationBasic
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'JobInformationBasic',
      type: {
        name: 'Composite',
        className: 'JobInformationBasic',
        modelProperties: {
          jobId: {
            required: false,
            readOnly: true,
            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,
            readOnly: true,
            serializedName: 'submitter',
            type: {
              name: 'String'
            }
          },
          degreeOfParallelism: {
            required: false,
            serializedName: 'degreeOfParallelism',
            defaultValue: 1,
            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'
                  }
              }
            }
          },
          related: {
            required: false,
            serializedName: 'related',
            type: {
              name: 'Composite',
              className: 'JobRelationshipProperties'
            }
          }
        }
      }
    };
  }
}

module.exports = JobInformationBasic;
