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

/**
 * Sub-protection policy which includes schedule and retention
 *
 */
class SubProtectionPolicy {
  /**
   * Create a SubProtectionPolicy.
   * @member {string} [policyType] Type of backup policy type. Possible values
   * include: 'Invalid', 'Full', 'Differential', 'Log', 'CopyOnlyFull'
   * @member {object} [schedulePolicy] Backup schedule specified as part of
   * backup policy.
   * @member {string} [schedulePolicy.schedulePolicyType] Polymorphic
   * Discriminator
   * @member {object} [retentionPolicy] Retention policy with the details on
   * backup copy retention ranges.
   * @member {string} [retentionPolicy.retentionPolicyType] Polymorphic
   * Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of SubProtectionPolicy
   *
   * @returns {object} metadata of SubProtectionPolicy
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'SubProtectionPolicy',
      type: {
        name: 'Composite',
        className: 'SubProtectionPolicy',
        modelProperties: {
          policyType: {
            required: false,
            serializedName: 'policyType',
            type: {
              name: 'String'
            }
          },
          schedulePolicy: {
            required: false,
            serializedName: 'schedulePolicy',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'schedulePolicyType',
                clientName: 'schedulePolicyType'
              },
              uberParent: 'SchedulePolicy',
              className: 'SchedulePolicy'
            }
          },
          retentionPolicy: {
            required: false,
            serializedName: 'retentionPolicy',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'retentionPolicyType',
                clientName: 'retentionPolicyType'
              },
              uberParent: 'RetentionPolicy',
              className: 'RetentionPolicy'
            }
          }
        }
      }
    };
  }
}

module.exports = SubProtectionPolicy;
