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

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

  /**
   * Defines the metadata of BackupEngineBase
   *
   * @returns {object} metadata of BackupEngineBase
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'BackupEngineBase',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'backupEngineType',
          clientName: 'backupEngineType'
        },
        uberParent: 'BackupEngineBase',
        className: 'BackupEngineBase',
        modelProperties: {
          friendlyName: {
            required: false,
            serializedName: 'friendlyName',
            type: {
              name: 'String'
            }
          },
          backupManagementType: {
            required: false,
            serializedName: 'backupManagementType',
            type: {
              name: 'String'
            }
          },
          registrationStatus: {
            required: false,
            serializedName: 'registrationStatus',
            type: {
              name: 'String'
            }
          },
          backupEngineState: {
            required: false,
            serializedName: 'backupEngineState',
            type: {
              name: 'String'
            }
          },
          healthStatus: {
            required: false,
            serializedName: 'healthStatus',
            type: {
              name: 'String'
            }
          },
          canReRegister: {
            required: false,
            serializedName: 'canReRegister',
            type: {
              name: 'Boolean'
            }
          },
          backupEngineId: {
            required: false,
            serializedName: 'backupEngineId',
            type: {
              name: 'String'
            }
          },
          dpmVersion: {
            required: false,
            serializedName: 'dpmVersion',
            type: {
              name: 'String'
            }
          },
          azureBackupAgentVersion: {
            required: false,
            serializedName: 'azureBackupAgentVersion',
            type: {
              name: 'String'
            }
          },
          isAzureBackupAgentUpgradeAvailable: {
            required: false,
            serializedName: 'isAzureBackupAgentUpgradeAvailable',
            type: {
              name: 'Boolean'
            }
          },
          isDpmUpgradeAvailable: {
            required: false,
            serializedName: 'isDpmUpgradeAvailable',
            type: {
              name: 'Boolean'
            }
          },
          extendedInfo: {
            required: false,
            serializedName: 'extendedInfo',
            type: {
              name: 'Composite',
              className: 'BackupEngineExtendedInfo'
            }
          },
          backupEngineType: {
            required: true,
            serializedName: 'backupEngineType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = BackupEngineBase;
