/*
 * 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 extended Data Lake Analytics job information properties returned when
 * retrieving a specific job.
 *
 * @extends models['JobInformationBasic']
 */
class JobInformation extends models['JobInformationBasic'] {
  /**
   * Create a JobInformation.
   * @member {array} [errorMessage] the error message details for the job, if
   * the job failed.
   * @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. Please note that
   * the maximum script size is 3 MB.
   * @member {string} [properties.type] Polymorphic Discriminator
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of JobInformation
   *
   * @returns {object} metadata of JobInformation
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'JobInformation',
      type: {
        name: 'Composite',
        className: 'JobInformation',
        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'
            }
          },
          errorMessage: {
            required: false,
            readOnly: true,
            serializedName: 'errorMessage',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'JobErrorDetailsElementType',
                  type: {
                    name: 'Composite',
                    className: 'JobErrorDetails'
                  }
              }
            }
          },
          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: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'JobProperties',
              className: 'JobProperties'
            }
          }
        }
      }
    };
  }
}

module.exports = JobInformation;
