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

/**
 * The base backup engine class. All workload specific backup engines derive
 * from this class.
 *
 * @extends models['Resource']
 */
class BackupEngineBaseResource extends models['Resource'] {
  /**
   * Create a BackupEngineBaseResource.
   * @member {object} [properties] BackupEngineBaseResource properties
   * @member {string} [properties.friendlyName] Friendly name of the backup
   * engine.
   * @member {string} [properties.backupManagementType] Type of backup
   * management for the backup engine. Possible values include: 'Invalid',
   * 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql',
   * 'AzureStorage', 'AzureWorkload', 'DefaultBackup'
   * @member {string} [properties.registrationStatus] Registration status of
   * the backup engine with the Recovery Services Vault.
   * @member {string} [properties.backupEngineState] Status of the backup
   * engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed}
   * @member {string} [properties.healthStatus] Backup status of the backup
   * engine.
   * @member {boolean} [properties.canReRegister] Flag indicating if the backup
   * engine be registered, once already registered.
   * @member {string} [properties.backupEngineId] ID of the backup engine.
   * @member {string} [properties.dpmVersion] Backup engine version
   * @member {string} [properties.azureBackupAgentVersion] Backup agent version
   * @member {boolean} [properties.isAzureBackupAgentUpgradeAvailable] To check
   * if backup agent upgrade available
   * @member {boolean} [properties.isDpmUpgradeAvailable] To check if backup
   * engine upgrade available
   * @member {object} [properties.extendedInfo] Extended info of the
   * backupengine
   * @member {string} [properties.extendedInfo.databaseName] Database name of
   * backup engine.
   * @member {number} [properties.extendedInfo.protectedItemsCount] Number of
   * protected items in the backup engine.
   * @member {number} [properties.extendedInfo.protectedServersCount] Number of
   * protected servers in the backup engine.
   * @member {number} [properties.extendedInfo.diskCount] Number of disks in
   * the backup engine.
   * @member {number} [properties.extendedInfo.usedDiskSpace] Diskspace used in
   * the backup engine.
   * @member {number} [properties.extendedInfo.availableDiskSpace] Diskspace
   * currently available in the backup engine.
   * @member {date} [properties.extendedInfo.refreshedAt] Last refresh time in
   * the backup engine.
   * @member {number} [properties.extendedInfo.azureProtectedInstances]
   * Protected instances in the backup engine.
   * @member {string} [properties.backupEngineType] Polymorphic Discriminator
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of BackupEngineBaseResource
   *
   * @returns {object} metadata of BackupEngineBaseResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'BackupEngineBaseResource',
      type: {
        name: 'Composite',
        className: 'BackupEngineBaseResource',
        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: 'backupEngineType',
                clientName: 'backupEngineType'
              },
              uberParent: 'BackupEngineBase',
              className: 'BackupEngineBase'
            }
          }
        }
      }
    };
  }
}

module.exports = BackupEngineBaseResource;
