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

/**
 * Schedules applicable to a virtual machine. The schedules may have been
 * defined on a VM or on lab level.
 *
 * @extends models['Resource']
 */
class ApplicableSchedule extends models['Resource'] {
  /**
   * Create a ApplicableSchedule.
   * @property {object} [labVmsShutdown] The auto-shutdown schedule, if one has
   * been set at the lab or lab resource level.
   * @property {string} [labVmsShutdown.status] The status of the schedule
   * (i.e. Enabled, Disabled). Possible values include: 'Enabled', 'Disabled'
   * @property {string} [labVmsShutdown.taskType] The task type of the schedule
   * (e.g. LabVmsShutdownTask, LabVmAutoStart).
   * @property {object} [labVmsShutdown.weeklyRecurrence] If the schedule will
   * occur only some days of the week, specify the weekly recurrence.
   * @property {array} [labVmsShutdown.weeklyRecurrence.weekdays] The days of
   * the week for which the schedule is set (e.g. Sunday, Monday, Tuesday,
   * etc.).
   * @property {string} [labVmsShutdown.weeklyRecurrence.time] The time of the
   * day the schedule will occur.
   * @property {object} [labVmsShutdown.dailyRecurrence] If the schedule will
   * occur once each day of the week, specify the daily recurrence.
   * @property {string} [labVmsShutdown.dailyRecurrence.time] The time of day
   * the schedule will occur.
   * @property {object} [labVmsShutdown.hourlyRecurrence] If the schedule will
   * occur multiple times a day, specify the hourly recurrence.
   * @property {number} [labVmsShutdown.hourlyRecurrence.minute] Minutes of the
   * hour the schedule will run.
   * @property {string} [labVmsShutdown.timeZoneId] The time zone ID (e.g.
   * Pacific Standard time).
   * @property {object} [labVmsShutdown.notificationSettings] Notification
   * settings.
   * @property {string} [labVmsShutdown.notificationSettings.status] If
   * notifications are enabled for this schedule (i.e. Enabled, Disabled).
   * Possible values include: 'Enabled', 'Disabled'
   * @property {number} [labVmsShutdown.notificationSettings.timeInMinutes]
   * Time in minutes before event at which notification will be sent.
   * @property {string} [labVmsShutdown.notificationSettings.webhookUrl] The
   * webhook URL to which the notification will be sent.
   * @property {string} [labVmsShutdown.notificationSettings.emailRecipient]
   * The email recipient to send notifications to (can be a list of semi-colon
   * separated email addresses).
   * @property {string}
   * [labVmsShutdown.notificationSettings.notificationLocale] The locale to use
   * when sending a notification (fallback for unsupported languages is EN).
   * @property {date} [labVmsShutdown.createdDate] The creation date of the
   * schedule.
   * @property {string} [labVmsShutdown.targetResourceId] The resource ID to
   * which the schedule belongs
   * @property {string} [labVmsShutdown.provisioningState] The provisioning
   * status of the resource.
   * @property {string} [labVmsShutdown.uniqueIdentifier] The unique immutable
   * identifier of a resource (Guid).
   * @property {object} [labVmsStartup] The auto-startup schedule, if one has
   * been set at the lab or lab resource level.
   * @property {string} [labVmsStartup.status] The status of the schedule (i.e.
   * Enabled, Disabled). Possible values include: 'Enabled', 'Disabled'
   * @property {string} [labVmsStartup.taskType] The task type of the schedule
   * (e.g. LabVmsShutdownTask, LabVmAutoStart).
   * @property {object} [labVmsStartup.weeklyRecurrence] If the schedule will
   * occur only some days of the week, specify the weekly recurrence.
   * @property {array} [labVmsStartup.weeklyRecurrence.weekdays] The days of
   * the week for which the schedule is set (e.g. Sunday, Monday, Tuesday,
   * etc.).
   * @property {string} [labVmsStartup.weeklyRecurrence.time] The time of the
   * day the schedule will occur.
   * @property {object} [labVmsStartup.dailyRecurrence] If the schedule will
   * occur once each day of the week, specify the daily recurrence.
   * @property {string} [labVmsStartup.dailyRecurrence.time] The time of day
   * the schedule will occur.
   * @property {object} [labVmsStartup.hourlyRecurrence] If the schedule will
   * occur multiple times a day, specify the hourly recurrence.
   * @property {number} [labVmsStartup.hourlyRecurrence.minute] Minutes of the
   * hour the schedule will run.
   * @property {string} [labVmsStartup.timeZoneId] The time zone ID (e.g.
   * Pacific Standard time).
   * @property {object} [labVmsStartup.notificationSettings] Notification
   * settings.
   * @property {string} [labVmsStartup.notificationSettings.status] If
   * notifications are enabled for this schedule (i.e. Enabled, Disabled).
   * Possible values include: 'Enabled', 'Disabled'
   * @property {number} [labVmsStartup.notificationSettings.timeInMinutes] Time
   * in minutes before event at which notification will be sent.
   * @property {string} [labVmsStartup.notificationSettings.webhookUrl] The
   * webhook URL to which the notification will be sent.
   * @property {string} [labVmsStartup.notificationSettings.emailRecipient] The
   * email recipient to send notifications to (can be a list of semi-colon
   * separated email addresses).
   * @property {string} [labVmsStartup.notificationSettings.notificationLocale]
   * The locale to use when sending a notification (fallback for unsupported
   * languages is EN).
   * @property {date} [labVmsStartup.createdDate] The creation date of the
   * schedule.
   * @property {string} [labVmsStartup.targetResourceId] The resource ID to
   * which the schedule belongs
   * @property {string} [labVmsStartup.provisioningState] The provisioning
   * status of the resource.
   * @property {string} [labVmsStartup.uniqueIdentifier] The unique immutable
   * identifier of a resource (Guid).
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ApplicableSchedule
   *
   * @returns {object} metadata of ApplicableSchedule
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicableSchedule',
      type: {
        name: 'Composite',
        className: 'ApplicableSchedule',
        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'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          labVmsShutdown: {
            required: false,
            serializedName: 'properties.labVmsShutdown',
            type: {
              name: 'Composite',
              className: 'Schedule'
            }
          },
          labVmsStartup: {
            required: false,
            serializedName: 'properties.labVmsStartup',
            type: {
              name: 'Composite',
              className: 'Schedule'
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicableSchedule;
