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

/**
 * Long term retention policy.
 *
 * @extends models['RetentionPolicy']
 */
class LongTermRetentionPolicy extends models['RetentionPolicy'] {
  /**
   * Create a LongTermRetentionPolicy.
   * @member {object} [dailySchedule] Daily retention schedule of the
   * protection policy.
   * @member {array} [dailySchedule.retentionTimes] Retention times of
   * retention policy.
   * @member {object} [dailySchedule.retentionDuration] Retention duration of
   * retention Policy.
   * @member {number} [dailySchedule.retentionDuration.count] Count of duration
   * types. Retention duration is obtained by the counting the duration type
   * Count times.
   * For example, when Count = 3 and DurationType = Weeks, retention duration
   * will be three weeks.
   * @member {string} [dailySchedule.retentionDuration.durationType] Retention
   * duration type of retention policy. Possible values include: 'Invalid',
   * 'Days', 'Weeks', 'Months', 'Years'
   * @member {object} [weeklySchedule] Weekly retention schedule of the
   * protection policy.
   * @member {array} [weeklySchedule.daysOfTheWeek] List of days of week for
   * weekly retention policy.
   * @member {array} [weeklySchedule.retentionTimes] Retention times of
   * retention policy.
   * @member {object} [weeklySchedule.retentionDuration] Retention duration of
   * retention Policy.
   * @member {number} [weeklySchedule.retentionDuration.count] Count of
   * duration types. Retention duration is obtained by the counting the
   * duration type Count times.
   * For example, when Count = 3 and DurationType = Weeks, retention duration
   * will be three weeks.
   * @member {string} [weeklySchedule.retentionDuration.durationType] Retention
   * duration type of retention policy. Possible values include: 'Invalid',
   * 'Days', 'Weeks', 'Months', 'Years'
   * @member {object} [monthlySchedule] Monthly retention schedule of the
   * protection policy.
   * @member {string} [monthlySchedule.retentionScheduleFormatType] Retention
   * schedule format type for monthly retention policy. Possible values
   * include: 'Invalid', 'Daily', 'Weekly'
   * @member {object} [monthlySchedule.retentionScheduleDaily] Daily retention
   * format for monthly retention policy.
   * @member {array} [monthlySchedule.retentionScheduleDaily.daysOfTheMonth]
   * List of days of the month.
   * @member {object} [monthlySchedule.retentionScheduleWeekly] Weekly
   * retention format for monthly retention policy.
   * @member {array} [monthlySchedule.retentionScheduleWeekly.daysOfTheWeek]
   * List of days of the week.
   * @member {array} [monthlySchedule.retentionScheduleWeekly.weeksOfTheMonth]
   * List of weeks of month.
   * @member {array} [monthlySchedule.retentionTimes] Retention times of
   * retention policy.
   * @member {object} [monthlySchedule.retentionDuration] Retention duration of
   * retention Policy.
   * @member {number} [monthlySchedule.retentionDuration.count] Count of
   * duration types. Retention duration is obtained by the counting the
   * duration type Count times.
   * For example, when Count = 3 and DurationType = Weeks, retention duration
   * will be three weeks.
   * @member {string} [monthlySchedule.retentionDuration.durationType]
   * Retention duration type of retention policy. Possible values include:
   * 'Invalid', 'Days', 'Weeks', 'Months', 'Years'
   * @member {object} [yearlySchedule] Yearly retention schedule of the
   * protection policy.
   * @member {string} [yearlySchedule.retentionScheduleFormatType] Retention
   * schedule format for yearly retention policy. Possible values include:
   * 'Invalid', 'Daily', 'Weekly'
   * @member {array} [yearlySchedule.monthsOfYear] List of months of year of
   * yearly retention policy.
   * @member {object} [yearlySchedule.retentionScheduleDaily] Daily retention
   * format for yearly retention policy.
   * @member {array} [yearlySchedule.retentionScheduleDaily.daysOfTheMonth]
   * List of days of the month.
   * @member {object} [yearlySchedule.retentionScheduleWeekly] Weekly retention
   * format for yearly retention policy.
   * @member {array} [yearlySchedule.retentionScheduleWeekly.daysOfTheWeek]
   * List of days of the week.
   * @member {array} [yearlySchedule.retentionScheduleWeekly.weeksOfTheMonth]
   * List of weeks of month.
   * @member {array} [yearlySchedule.retentionTimes] Retention times of
   * retention policy.
   * @member {object} [yearlySchedule.retentionDuration] Retention duration of
   * retention Policy.
   * @member {number} [yearlySchedule.retentionDuration.count] Count of
   * duration types. Retention duration is obtained by the counting the
   * duration type Count times.
   * For example, when Count = 3 and DurationType = Weeks, retention duration
   * will be three weeks.
   * @member {string} [yearlySchedule.retentionDuration.durationType] Retention
   * duration type of retention policy. Possible values include: 'Invalid',
   * 'Days', 'Weeks', 'Months', 'Years'
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of LongTermRetentionPolicy
   *
   * @returns {object} metadata of LongTermRetentionPolicy
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'LongTermRetentionPolicy',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'retentionPolicyType',
          clientName: 'retentionPolicyType'
        },
        uberParent: 'RetentionPolicy',
        className: 'LongTermRetentionPolicy',
        modelProperties: {
          retentionPolicyType: {
            required: true,
            serializedName: 'retentionPolicyType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          dailySchedule: {
            required: false,
            serializedName: 'dailySchedule',
            type: {
              name: 'Composite',
              className: 'DailyRetentionSchedule'
            }
          },
          weeklySchedule: {
            required: false,
            serializedName: 'weeklySchedule',
            type: {
              name: 'Composite',
              className: 'WeeklyRetentionSchedule'
            }
          },
          monthlySchedule: {
            required: false,
            serializedName: 'monthlySchedule',
            type: {
              name: 'Composite',
              className: 'MonthlyRetentionSchedule'
            }
          },
          yearlySchedule: {
            required: false,
            serializedName: 'yearlySchedule',
            type: {
              name: 'Composite',
              className: 'YearlyRetentionSchedule'
            }
          }
        }
      }
    };
  }
}

module.exports = LongTermRetentionPolicy;
