/*
 * 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 retention.
 *
 * @extends models['RetentionPolicy']
 */
class SimpleRetentionPolicy extends models['RetentionPolicy'] {
  /**
   * Create a SimpleRetentionPolicy.
   * @member {object} [retentionDuration] Retention duration of the protection
   * policy.
   * @member {number} [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} [retentionDuration.durationType] Retention duration type
   * of retention policy. Possible values include: 'Invalid', 'Days', 'Weeks',
   * 'Months', 'Years'
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of SimpleRetentionPolicy
   *
   * @returns {object} metadata of SimpleRetentionPolicy
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'SimpleRetentionPolicy',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'retentionPolicyType',
          clientName: 'retentionPolicyType'
        },
        uberParent: 'RetentionPolicy',
        className: 'SimpleRetentionPolicy',
        modelProperties: {
          retentionPolicyType: {
            required: true,
            serializedName: 'retentionPolicyType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          retentionDuration: {
            required: false,
            serializedName: 'retentionDuration',
            type: {
              name: 'Composite',
              className: 'RetentionDuration'
            }
          }
        }
      }
    };
  }
}

module.exports = SimpleRetentionPolicy;
