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

/**
 * Base class for backup items.
 *
 */
class ProtectedItem {
  /**
   * Create a ProtectedItem.
   * @member {string} [backupManagementType] Type of backup managemenent for
   * the backed up item. Possible values include: 'Invalid', 'AzureIaasVM',
   * 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage',
   * 'AzureWorkload', 'DefaultBackup'
   * @member {string} [workloadType] Type of workload this item represents.
   * Possible values include: 'Invalid', 'VM', 'FileFolder', 'AzureSqlDb',
   * 'SQLDB', 'Exchange', 'Sharepoint', 'VMwareVM', 'SystemState', 'Client',
   * 'GenericDataSource', 'SQLDataBase', 'AzureFileShare', 'SAPHanaDatabase'
   * @member {string} [containerName] Unique name of container
   * @member {string} [sourceResourceId] ARM ID of the resource to be backed
   * up.
   * @member {string} [policyId] ID of the backup policy with which this item
   * is backed up.
   * @member {date} [lastRecoveryPoint] Timestamp when the last (latest) backup
   * copy was created for this backup item.
   * @member {string} [backupSetName] Name of the backup set the backup item
   * belongs to
   * @member {string} [createMode] Create mode to indicate recovery of existing
   * soft deleted data source or creation of new data source. Possible values
   * include: 'Invalid', 'Default', 'Recover'
   * @member {string} protectedItemType Polymorphic Discriminator
   */
  constructor() {
  }

  /**
   * Defines the metadata of ProtectedItem
   *
   * @returns {object} metadata of ProtectedItem
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ProtectedItem',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'protectedItemType',
          clientName: 'protectedItemType'
        },
        uberParent: 'ProtectedItem',
        className: 'ProtectedItem',
        modelProperties: {
          backupManagementType: {
            required: false,
            serializedName: 'backupManagementType',
            type: {
              name: 'String'
            }
          },
          workloadType: {
            required: false,
            serializedName: 'workloadType',
            type: {
              name: 'String'
            }
          },
          containerName: {
            required: false,
            serializedName: 'containerName',
            type: {
              name: 'String'
            }
          },
          sourceResourceId: {
            required: false,
            serializedName: 'sourceResourceId',
            type: {
              name: 'String'
            }
          },
          policyId: {
            required: false,
            serializedName: 'policyId',
            type: {
              name: 'String'
            }
          },
          lastRecoveryPoint: {
            required: false,
            serializedName: 'lastRecoveryPoint',
            type: {
              name: 'DateTime'
            }
          },
          backupSetName: {
            required: false,
            serializedName: 'backupSetName',
            type: {
              name: 'String'
            }
          },
          createMode: {
            required: false,
            serializedName: 'createMode',
            type: {
              name: 'String'
            }
          },
          protectedItemType: {
            required: true,
            serializedName: 'protectedItemType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ProtectedItem;
