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

/**
 * Simple policy schedule.
 *
 * @extends models['SchedulePolicy']
 */
class SimpleSchedulePolicy extends models['SchedulePolicy'] {
  /**
   * Create a SimpleSchedulePolicy.
   * @member {string} [scheduleRunFrequency] Frequency of the schedule
   * operation of this policy. Possible values include: 'Invalid', 'Daily',
   * 'Weekly'
   * @member {array} [scheduleRunDays] List of days of week this schedule has
   * to be run.
   * @member {array} [scheduleRunTimes] List of times of day this schedule has
   * to be run.
   * @member {number} [scheduleWeeklyFrequency] At every number weeks this
   * schedule has to be run.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of SimpleSchedulePolicy
   *
   * @returns {object} metadata of SimpleSchedulePolicy
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'SimpleSchedulePolicy',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'schedulePolicyType',
          clientName: 'schedulePolicyType'
        },
        uberParent: 'SchedulePolicy',
        className: 'SimpleSchedulePolicy',
        modelProperties: {
          schedulePolicyType: {
            required: true,
            serializedName: 'schedulePolicyType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          scheduleRunFrequency: {
            required: false,
            serializedName: 'scheduleRunFrequency',
            type: {
              name: 'String'
            }
          },
          scheduleRunDays: {
            required: false,
            serializedName: 'scheduleRunDays',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'DayOfWeekElementType',
                  type: {
                    name: 'Enum',
                    allowedValues: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ]
                  }
              }
            }
          },
          scheduleRunTimes: {
            required: false,
            serializedName: 'scheduleRunTimes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'DateElementType',
                  type: {
                    name: 'DateTime'
                  }
              }
            }
          },
          scheduleWeeklyFrequency: {
            required: false,
            serializedName: 'scheduleWeeklyFrequency',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = SimpleSchedulePolicy;
