// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.recoveryservicesbackup.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** The base backup engine class. All workload specific backup engines derive from this class. */
@JsonTypeInfo(
    use = JsonTypeInfo.Id.NAME,
    include = JsonTypeInfo.As.PROPERTY,
    property = "backupEngineType",
    defaultImpl = BackupEngineBase.class)
@JsonTypeName("BackupEngineBase")
@JsonSubTypes({
    @JsonSubTypes.Type(name = "AzureBackupServerEngine", value = AzureBackupServerEngine.class),
    @JsonSubTypes.Type(name = "DpmBackupEngine", value = DpmBackupEngine.class)
})
@Fluent
public class BackupEngineBase {
    /*
     * Friendly name of the backup engine.
     */
    @JsonProperty(value = "friendlyName")
    private String friendlyName;

    /*
     * Type of backup management for the backup engine.
     */
    @JsonProperty(value = "backupManagementType")
    private BackupManagementType backupManagementType;

    /*
     * Registration status of the backup engine with the Recovery Services Vault.
     */
    @JsonProperty(value = "registrationStatus")
    private String registrationStatus;

    /*
     * Status of the backup engine with the Recovery Services Vault. = {Active/Deleting/DeleteFailed}
     */
    @JsonProperty(value = "backupEngineState")
    private String backupEngineState;

    /*
     * Backup status of the backup engine.
     */
    @JsonProperty(value = "healthStatus")
    private String healthStatus;

    /*
     * Flag indicating if the backup engine be registered, once already registered.
     */
    @JsonProperty(value = "canReRegister")
    private Boolean canReRegister;

    /*
     * ID of the backup engine.
     */
    @JsonProperty(value = "backupEngineId")
    private String backupEngineId;

    /*
     * Backup engine version
     */
    @JsonProperty(value = "dpmVersion")
    private String dpmVersion;

    /*
     * Backup agent version
     */
    @JsonProperty(value = "azureBackupAgentVersion")
    private String azureBackupAgentVersion;

    /*
     * To check if backup agent upgrade available
     */
    @JsonProperty(value = "isAzureBackupAgentUpgradeAvailable")
    private Boolean isAzureBackupAgentUpgradeAvailable;

    /*
     * To check if backup engine upgrade available
     */
    @JsonProperty(value = "isDpmUpgradeAvailable")
    private Boolean isDpmUpgradeAvailable;

    /*
     * Extended info of the backupengine
     */
    @JsonProperty(value = "extendedInfo")
    private BackupEngineExtendedInfo extendedInfo;

    /** Creates an instance of BackupEngineBase class. */
    public BackupEngineBase() {
    }

    /**
     * Get the friendlyName property: Friendly name of the backup engine.
     *
     * @return the friendlyName value.
     */
    public String friendlyName() {
        return this.friendlyName;
    }

    /**
     * Set the friendlyName property: Friendly name of the backup engine.
     *
     * @param friendlyName the friendlyName value to set.
     * @return the BackupEngineBase object itself.
     */
    public BackupEngineBase withFriendlyName(String friendlyName) {
        this.friendlyName = friendlyName;
        return this;
    }

    /**
     * Get the backupManagementType property: Type of backup management for the backup engine.
     *
     * @return the backupManagementType value.
     */
    public BackupManagementType backupManagementType() {
        return this.backupManagementType;
    }

    /**
     * Set the backupManagementType property: Type of backup management for the backup engine.
     *
     * @param backupManagementType the backupManagementType value to set.
     * @return the BackupEngineBase object itself.
     */
    public BackupEngineBase withBackupManagementType(BackupManagementType backupManagementType) {
        this.backupManagementType = backupManagementType;
        return this;
    }

    /**
     * Get the registrationStatus property: Registration status of the backup engine with the Recovery Services Vault.
     *
     * @return the registrationStatus value.
     */
    public String registrationStatus() {
        return this.registrationStatus;
    }

    /**
     * Set the registrationStatus property: Registration status of the backup engine with the Recovery Services Vault.
     *
     * @param registrationStatus the registrationStatus value to set.
     * @return the BackupEngineBase object itself.
     */
    public BackupEngineBase withRegistrationStatus(String registrationStatus) {
        this.registrationStatus = registrationStatus;
        return this;
    }

    /**
     * Get the backupEngineState property: Status of the backup engine with the Recovery Services Vault. =
     * {Active/Deleting/DeleteFailed}.
     *
     * @return the backupEngineState value.
     */
    public String backupEngineState() {
        return this.backupEngineState;
    }

    /**
     * Set the backupEngineState property: Status of the backup engine with the Recovery Services Vault. =
     * {Active/Deleting/DeleteFailed}.
     *
     * @param backupEngineState the backupEngineState value to set.
     * @return the BackupEngineBase object itself.
     */
    public BackupEngineBase withBackupEngineState(String backupEngineState) {
        this.backupEngineState = backupEngineState;
        return this;
    }

    /**
     * Get the healthStatus property: Backup status of the backup engine.
     *
     * @return the healthStatus value.
     */
    public String healthStatus() {
        return this.healthStatus;
    }

    /**
     * Set the healthStatus property: Backup status of the backup engine.
     *
     * @param healthStatus the healthStatus value to set.
     * @return the BackupEngineBase object itself.
     */
    public BackupEngineBase withHealthStatus(String healthStatus) {
        this.healthStatus = healthStatus;
        return this;
    }

    /**
     * Get the canReRegister property: Flag indicating if the backup engine be registered, once already registered.
     *
     * @return the canReRegister value.
     */
    public Boolean canReRegister() {
        return this.canReRegister;
    }

    /**
     * Set the canReRegister property: Flag indicating if the backup engine be registered, once already registered.
     *
     * @param canReRegister the canReRegister value to set.
     * @return the BackupEngineBase object itself.
     */
    public BackupEngineBase withCanReRegister(Boolean canReRegister) {
        this.canReRegister = canReRegister;
        return this;
    }

    /**
     * Get the backupEngineId property: ID of the backup engine.
     *
     * @return the backupEngineId value.
     */
    public String backupEngineId() {
        return this.backupEngineId;
    }

    /**
     * Set the backupEngineId property: ID of the backup engine.
     *
     * @param backupEngineId the backupEngineId value to set.
     * @return the BackupEngineBase object itself.
     */
    public BackupEngineBase withBackupEngineId(String backupEngineId) {
        this.backupEngineId = backupEngineId;
        return this;
    }

    /**
     * Get the dpmVersion property: Backup engine version.
     *
     * @return the dpmVersion value.
     */
    public String dpmVersion() {
        return this.dpmVersion;
    }

    /**
     * Set the dpmVersion property: Backup engine version.
     *
     * @param dpmVersion the dpmVersion value to set.
     * @return the BackupEngineBase object itself.
     */
    public BackupEngineBase withDpmVersion(String dpmVersion) {
        this.dpmVersion = dpmVersion;
        return this;
    }

    /**
     * Get the azureBackupAgentVersion property: Backup agent version.
     *
     * @return the azureBackupAgentVersion value.
     */
    public String azureBackupAgentVersion() {
        return this.azureBackupAgentVersion;
    }

    /**
     * Set the azureBackupAgentVersion property: Backup agent version.
     *
     * @param azureBackupAgentVersion the azureBackupAgentVersion value to set.
     * @return the BackupEngineBase object itself.
     */
    public BackupEngineBase withAzureBackupAgentVersion(String azureBackupAgentVersion) {
        this.azureBackupAgentVersion = azureBackupAgentVersion;
        return this;
    }

    /**
     * Get the isAzureBackupAgentUpgradeAvailable property: To check if backup agent upgrade available.
     *
     * @return the isAzureBackupAgentUpgradeAvailable value.
     */
    public Boolean isAzureBackupAgentUpgradeAvailable() {
        return this.isAzureBackupAgentUpgradeAvailable;
    }

    /**
     * Set the isAzureBackupAgentUpgradeAvailable property: To check if backup agent upgrade available.
     *
     * @param isAzureBackupAgentUpgradeAvailable the isAzureBackupAgentUpgradeAvailable value to set.
     * @return the BackupEngineBase object itself.
     */
    public BackupEngineBase withIsAzureBackupAgentUpgradeAvailable(Boolean isAzureBackupAgentUpgradeAvailable) {
        this.isAzureBackupAgentUpgradeAvailable = isAzureBackupAgentUpgradeAvailable;
        return this;
    }

    /**
     * Get the isDpmUpgradeAvailable property: To check if backup engine upgrade available.
     *
     * @return the isDpmUpgradeAvailable value.
     */
    public Boolean isDpmUpgradeAvailable() {
        return this.isDpmUpgradeAvailable;
    }

    /**
     * Set the isDpmUpgradeAvailable property: To check if backup engine upgrade available.
     *
     * @param isDpmUpgradeAvailable the isDpmUpgradeAvailable value to set.
     * @return the BackupEngineBase object itself.
     */
    public BackupEngineBase withIsDpmUpgradeAvailable(Boolean isDpmUpgradeAvailable) {
        this.isDpmUpgradeAvailable = isDpmUpgradeAvailable;
        return this;
    }

    /**
     * Get the extendedInfo property: Extended info of the backupengine.
     *
     * @return the extendedInfo value.
     */
    public BackupEngineExtendedInfo extendedInfo() {
        return this.extendedInfo;
    }

    /**
     * Set the extendedInfo property: Extended info of the backupengine.
     *
     * @param extendedInfo the extendedInfo value to set.
     * @return the BackupEngineBase object itself.
     */
    public BackupEngineBase withExtendedInfo(BackupEngineExtendedInfo extendedInfo) {
        this.extendedInfo = extendedInfo;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (extendedInfo() != null) {
            extendedInfo().validate();
        }
    }
}
