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

/**
 * The parameters supplied to the create or update schedule operation.
 *
 */
class ScheduleCreateOrUpdateParameters {
  /**
   * Create a ScheduleCreateOrUpdateParameters.
   * @member {string} name Gets or sets the name of the Schedule.
   * @member {string} [description] Gets or sets the description of the
   * schedule.
   * @member {date} startTime Gets or sets the start time of the schedule.
   * @member {date} [expiryTime] Gets or sets the end time of the schedule.
   * @member {object} [interval] Gets or sets the interval of the schedule.
   * @member {string} frequency Possible values include: 'OneTime', 'Day',
   * 'Hour', 'Week', 'Month'
   * @member {string} [timeZone] Gets or sets the time zone of the schedule.
   * @member {object} [advancedSchedule] Gets or sets the AdvancedSchedule.
   * @member {array} [advancedSchedule.weekDays] Days of the week that the job
   * should execute on.
   * @member {array} [advancedSchedule.monthDays] Days of the month that the
   * job should execute on. Must be between 1 and 31.
   * @member {array} [advancedSchedule.monthlyOccurrences] Occurrences of days
   * within a month.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ScheduleCreateOrUpdateParameters
   *
   * @returns {object} metadata of ScheduleCreateOrUpdateParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ScheduleCreateOrUpdateParameters',
      type: {
        name: 'Composite',
        className: 'ScheduleCreateOrUpdateParameters',
        modelProperties: {
          name: {
            required: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            type: {
              name: 'String'
            }
          },
          startTime: {
            required: true,
            nullable: false,
            serializedName: 'properties.startTime',
            type: {
              name: 'DateTime'
            }
          },
          expiryTime: {
            required: false,
            nullable: true,
            serializedName: 'properties.expiryTime',
            type: {
              name: 'DateTime'
            }
          },
          interval: {
            required: false,
            serializedName: 'properties.interval',
            type: {
              name: 'Object'
            }
          },
          frequency: {
            required: true,
            serializedName: 'properties.frequency',
            type: {
              name: 'String'
            }
          },
          timeZone: {
            required: false,
            serializedName: 'properties.timeZone',
            type: {
              name: 'String'
            }
          },
          advancedSchedule: {
            required: false,
            serializedName: 'properties.advancedSchedule',
            type: {
              name: 'Composite',
              className: 'AdvancedSchedule'
            }
          }
        }
      }
    };
  }
}

module.exports = ScheduleCreateOrUpdateParameters;
