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

/**
 * A job.
 *
 * @extends models['ProxyResource']
 */
class Job extends models['ProxyResource'] {
  /**
   * Create a Job.
   * @property {string} [description] User-defined description of the job.
   * Default value: '' .
   * @property {number} [version] The job version number.
   * @property {object} [schedule] Schedule properties of the job.
   * @property {date} [schedule.startTime] Schedule start time.
   * @property {date} [schedule.endTime] Schedule end time.
   * @property {string} [schedule.type] Schedule interval type. Possible values
   * include: 'Once', 'Recurring'
   * @property {boolean} [schedule.enabled] Whether or not the schedule is
   * enabled.
   * @property {string} [schedule.interval] Value of the schedule's recurring
   * interval, if the schedule type is recurring. ISO8601 duration format.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Job
   *
   * @returns {object} metadata of Job
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Job',
      type: {
        name: 'Composite',
        className: 'Job',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            defaultValue: '',
            type: {
              name: 'String'
            }
          },
          version: {
            required: false,
            readOnly: true,
            serializedName: 'properties.version',
            type: {
              name: 'Number'
            }
          },
          schedule: {
            required: false,
            serializedName: 'properties.schedule',
            type: {
              name: 'Composite',
              className: 'JobSchedule'
            }
          }
        }
      }
    };
  }
}

module.exports = Job;
