/*
 * 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 parameters used to submit a new Data Lake Analytics job.
 *
 * @extends models['BaseJobParameters']
 */
class CreateJobParameters extends models['BaseJobParameters'] {
  /**
   * Create a CreateJobParameters.
   * @member {string} name the friendly name of the job to submit.
   * @member {number} [degreeOfParallelism] the degree of parallelism to use
   * 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 to use 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 {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() {
    super();
  }

  /**
   * Defines the metadata of CreateJobParameters
   *
   * @returns {object} metadata of CreateJobParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'CreateJobParameters',
      type: {
        name: 'Composite',
        className: 'CreateJobParameters',
        modelProperties: {
          type: {
            required: true,
            serializedName: 'type',
            type: {
              name: 'Enum',
              allowedValues: [ 'USql', 'Hive' ]
            }
          },
          properties: {
            required: true,
            serializedName: 'properties',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'CreateJobProperties',
              className: 'CreateJobProperties'
            }
          },
          name: {
            required: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          degreeOfParallelism: {
            required: false,
            serializedName: 'degreeOfParallelism',
            defaultValue: 1,
            type: {
              name: 'Number'
            }
          },
          priority: {
            required: false,
            serializedName: 'priority',
            type: {
              name: 'Number'
            }
          },
          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 = CreateJobParameters;
