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

/**
 * The backup schedule.
 *
 * @extends models['BaseModel']
 */
class BackupSchedule extends models['BaseModel'] {
  /**
   * Create a BackupSchedule.
   * @member {object} scheduleRecurrence The schedule recurrence.
   * @member {string} [scheduleRecurrence.recurrenceType] The recurrence type.
   * Possible values include: 'Minutes', 'Hourly', 'Daily', 'Weekly'
   * @member {number} [scheduleRecurrence.recurrenceValue] The recurrence
   * value.
   * @member {array} [scheduleRecurrence.weeklyDaysList] The week days list.
   * Applicable only for schedules of recurrence type 'weekly'.
   * @member {string} backupType The type of backup which needs to be taken.
   * Possible values include: 'LocalSnapshot', 'CloudSnapshot'
   * @member {number} retentionCount The number of backups to be retained.
   * @member {date} startTime The start time of the schedule.
   * @member {string} scheduleStatus The schedule status. Possible values
   * include: 'Enabled', 'Disabled'
   * @member {date} [lastSuccessfulRun] The last successful backup run which
   * was triggered for the schedule.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of BackupSchedule
   *
   * @returns {object} metadata of BackupSchedule
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'BackupSchedule',
      type: {
        name: 'Composite',
        className: 'BackupSchedule',
        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'
            }
          },
          kind: {
            required: false,
            serializedName: 'kind',
            type: {
              name: 'Enum',
              allowedValues: [ 'Series8000' ]
            }
          },
          scheduleRecurrence: {
            required: true,
            serializedName: 'properties.scheduleRecurrence',
            type: {
              name: 'Composite',
              className: 'ScheduleRecurrence'
            }
          },
          backupType: {
            required: true,
            serializedName: 'properties.backupType',
            type: {
              name: 'Enum',
              allowedValues: [ 'LocalSnapshot', 'CloudSnapshot' ]
            }
          },
          retentionCount: {
            required: true,
            serializedName: 'properties.retentionCount',
            type: {
              name: 'Number'
            }
          },
          startTime: {
            required: true,
            serializedName: 'properties.startTime',
            type: {
              name: 'DateTime'
            }
          },
          scheduleStatus: {
            required: true,
            serializedName: 'properties.scheduleStatus',
            type: {
              name: 'Enum',
              allowedValues: [ 'Enabled', 'Disabled' ]
            }
          },
          lastSuccessfulRun: {
            required: false,
            readOnly: true,
            serializedName: 'properties.lastSuccessfulRun',
            type: {
              name: 'DateTime'
            }
          }
        }
      }
    };
  }
}

module.exports = BackupSchedule;
