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

/**
 * Scheduling properties of a job.
 *
 */
class JobSchedule {
  /**
   * Create a JobSchedule.
   * @property {date} [startTime] Schedule start time. Default value: new
   * Date('0001-01-01T00:00:00Z') .
   * @property {date} [endTime] Schedule end time. Default value: new
   * Date('9999-12-31T11:59:59Z') .
   * @property {string} [type] Schedule interval type. Possible values include:
   * 'Once', 'Recurring'. Default value: 'Once' .
   * @property {boolean} [enabled] Whether or not the schedule is enabled.
   * @property {string} [interval] Value of the schedule's recurring interval,
   * if the schedule type is recurring. ISO8601 duration format.
   */
  constructor() {
  }

  /**
   * Defines the metadata of JobSchedule
   *
   * @returns {object} metadata of JobSchedule
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'JobSchedule',
      type: {
        name: 'Composite',
        className: 'JobSchedule',
        modelProperties: {
          startTime: {
            required: false,
            serializedName: 'startTime',
            defaultValue: new Date('0001-01-01T00:00:00Z'),
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            serializedName: 'endTime',
            defaultValue: new Date('9999-12-31T11:59:59Z'),
            type: {
              name: 'DateTime'
            }
          },
          type: {
            required: false,
            serializedName: 'type',
            defaultValue: 'Once',
            type: {
              name: 'Enum',
              allowedValues: [ 'Once', 'Recurring' ]
            }
          },
          enabled: {
            required: false,
            serializedName: 'enabled',
            type: {
              name: 'Boolean'
            }
          },
          interval: {
            required: false,
            serializedName: 'interval',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = JobSchedule;
