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

/**
 * Base class for backup items.
 *
 * @extends models['Resource']
 */
class ProtectedItemResource extends models['Resource'] {
  /**
   * Create a ProtectedItemResource.
   * @member {object} [properties] ProtectedItemResource properties
   * @member {string} [properties.backupManagementType] Type of backup
   * managemenent for the backed up item. Possible values include: 'Invalid',
   * 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql',
   * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'
   * @member {string} [properties.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} [properties.containerName] Unique name of container
   * @member {string} [properties.sourceResourceId] ARM ID of the resource to
   * be backed up.
   * @member {string} [properties.policyId] ID of the backup policy with which
   * this item is backed up.
   * @member {date} [properties.lastRecoveryPoint] Timestamp when the last
   * (latest) backup copy was created for this backup item.
   * @member {string} [properties.backupSetName] Name of the backup set the
   * backup item belongs to
   * @member {string} [properties.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} [properties.protectedItemType] Polymorphic Discriminator
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ProtectedItemResource
   *
   * @returns {object} metadata of ProtectedItemResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ProtectedItemResource',
      type: {
        name: 'Composite',
        className: 'ProtectedItemResource',
        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'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          eTag: {
            required: false,
            serializedName: 'eTag',
            type: {
              name: 'String'
            }
          },
          properties: {
            required: false,
            serializedName: 'properties',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'protectedItemType',
                clientName: 'protectedItemType'
              },
              uberParent: 'ProtectedItem',
              className: 'ProtectedItem'
            }
          }
        }
      }
    };
  }
}

module.exports = ProtectedItemResource;
