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

package com.azure.resourcemanager.recoveryservicessiterecovery.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** Recovery services provider properties. */
@Fluent
public final class RecoveryServicesProviderProperties {
    /*
     * Type of the site.
     */
    @JsonProperty(value = "fabricType")
    private String fabricType;

    /*
     * Friendly name of the DRA.
     */
    @JsonProperty(value = "friendlyName")
    private String friendlyName;

    /*
     * The provider version.
     */
    @JsonProperty(value = "providerVersion")
    private String providerVersion;

    /*
     * The fabric provider.
     */
    @JsonProperty(value = "serverVersion")
    private String serverVersion;

    /*
     * DRA version status.
     */
    @JsonProperty(value = "providerVersionState")
    private String providerVersionState;

    /*
     * Expiry date of the version.
     */
    @JsonProperty(value = "providerVersionExpiryDate")
    private OffsetDateTime providerVersionExpiryDate;

    /*
     * The fabric friendly name.
     */
    @JsonProperty(value = "fabricFriendlyName")
    private String fabricFriendlyName;

    /*
     * Time when last heartbeat was sent by the DRA.
     */
    @JsonProperty(value = "lastHeartBeat")
    private OffsetDateTime lastHeartBeat;

    /*
     * A value indicating whether DRA is responsive.
     */
    @JsonProperty(value = "connectionStatus")
    private String connectionStatus;

    /*
     * Number of protected VMs currently managed by the DRA.
     */
    @JsonProperty(value = "protectedItemCount")
    private Integer protectedItemCount;

    /*
     * The scenarios allowed on this provider.
     */
    @JsonProperty(value = "allowedScenarios")
    private List<String> allowedScenarios;

    /*
     * The recovery services provider health error details.
     */
    @JsonProperty(value = "healthErrorDetails")
    private List<HealthError> healthErrorDetails;

    /*
     * The DRA Id.
     */
    @JsonProperty(value = "draIdentifier")
    private String draIdentifier;

    /*
     * The machine Id.
     */
    @JsonProperty(value = "machineId")
    private String machineId;

    /*
     * The machine name.
     */
    @JsonProperty(value = "machineName")
    private String machineName;

    /*
     * The Bios Id.
     */
    @JsonProperty(value = "biosId")
    private String biosId;

    /*
     * The authentication identity details.
     */
    @JsonProperty(value = "authenticationIdentityDetails")
    private IdentityProviderDetails authenticationIdentityDetails;

    /*
     * The resource access identity details.
     */
    @JsonProperty(value = "resourceAccessIdentityDetails")
    private IdentityProviderDetails resourceAccessIdentityDetails;

    /*
     * The data plane authentication identity details.
     */
    @JsonProperty(value = "dataPlaneAuthenticationIdentityDetails")
    private IdentityProviderDetails dataPlaneAuthenticationIdentityDetails;

    /*
     * The provider version details.
     */
    @JsonProperty(value = "providerVersionDetails")
    private VersionDetails providerVersionDetails;

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

    /**
     * Get the fabricType property: Type of the site.
     *
     * @return the fabricType value.
     */
    public String fabricType() {
        return this.fabricType;
    }

    /**
     * Set the fabricType property: Type of the site.
     *
     * @param fabricType the fabricType value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withFabricType(String fabricType) {
        this.fabricType = fabricType;
        return this;
    }

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

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

    /**
     * Get the providerVersion property: The provider version.
     *
     * @return the providerVersion value.
     */
    public String providerVersion() {
        return this.providerVersion;
    }

    /**
     * Set the providerVersion property: The provider version.
     *
     * @param providerVersion the providerVersion value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withProviderVersion(String providerVersion) {
        this.providerVersion = providerVersion;
        return this;
    }

    /**
     * Get the serverVersion property: The fabric provider.
     *
     * @return the serverVersion value.
     */
    public String serverVersion() {
        return this.serverVersion;
    }

    /**
     * Set the serverVersion property: The fabric provider.
     *
     * @param serverVersion the serverVersion value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withServerVersion(String serverVersion) {
        this.serverVersion = serverVersion;
        return this;
    }

    /**
     * Get the providerVersionState property: DRA version status.
     *
     * @return the providerVersionState value.
     */
    public String providerVersionState() {
        return this.providerVersionState;
    }

    /**
     * Set the providerVersionState property: DRA version status.
     *
     * @param providerVersionState the providerVersionState value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withProviderVersionState(String providerVersionState) {
        this.providerVersionState = providerVersionState;
        return this;
    }

    /**
     * Get the providerVersionExpiryDate property: Expiry date of the version.
     *
     * @return the providerVersionExpiryDate value.
     */
    public OffsetDateTime providerVersionExpiryDate() {
        return this.providerVersionExpiryDate;
    }

    /**
     * Set the providerVersionExpiryDate property: Expiry date of the version.
     *
     * @param providerVersionExpiryDate the providerVersionExpiryDate value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withProviderVersionExpiryDate(OffsetDateTime providerVersionExpiryDate) {
        this.providerVersionExpiryDate = providerVersionExpiryDate;
        return this;
    }

    /**
     * Get the fabricFriendlyName property: The fabric friendly name.
     *
     * @return the fabricFriendlyName value.
     */
    public String fabricFriendlyName() {
        return this.fabricFriendlyName;
    }

    /**
     * Set the fabricFriendlyName property: The fabric friendly name.
     *
     * @param fabricFriendlyName the fabricFriendlyName value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withFabricFriendlyName(String fabricFriendlyName) {
        this.fabricFriendlyName = fabricFriendlyName;
        return this;
    }

    /**
     * Get the lastHeartBeat property: Time when last heartbeat was sent by the DRA.
     *
     * @return the lastHeartBeat value.
     */
    public OffsetDateTime lastHeartBeat() {
        return this.lastHeartBeat;
    }

    /**
     * Set the lastHeartBeat property: Time when last heartbeat was sent by the DRA.
     *
     * @param lastHeartBeat the lastHeartBeat value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withLastHeartBeat(OffsetDateTime lastHeartBeat) {
        this.lastHeartBeat = lastHeartBeat;
        return this;
    }

    /**
     * Get the connectionStatus property: A value indicating whether DRA is responsive.
     *
     * @return the connectionStatus value.
     */
    public String connectionStatus() {
        return this.connectionStatus;
    }

    /**
     * Set the connectionStatus property: A value indicating whether DRA is responsive.
     *
     * @param connectionStatus the connectionStatus value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withConnectionStatus(String connectionStatus) {
        this.connectionStatus = connectionStatus;
        return this;
    }

    /**
     * Get the protectedItemCount property: Number of protected VMs currently managed by the DRA.
     *
     * @return the protectedItemCount value.
     */
    public Integer protectedItemCount() {
        return this.protectedItemCount;
    }

    /**
     * Set the protectedItemCount property: Number of protected VMs currently managed by the DRA.
     *
     * @param protectedItemCount the protectedItemCount value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withProtectedItemCount(Integer protectedItemCount) {
        this.protectedItemCount = protectedItemCount;
        return this;
    }

    /**
     * Get the allowedScenarios property: The scenarios allowed on this provider.
     *
     * @return the allowedScenarios value.
     */
    public List<String> allowedScenarios() {
        return this.allowedScenarios;
    }

    /**
     * Set the allowedScenarios property: The scenarios allowed on this provider.
     *
     * @param allowedScenarios the allowedScenarios value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withAllowedScenarios(List<String> allowedScenarios) {
        this.allowedScenarios = allowedScenarios;
        return this;
    }

    /**
     * Get the healthErrorDetails property: The recovery services provider health error details.
     *
     * @return the healthErrorDetails value.
     */
    public List<HealthError> healthErrorDetails() {
        return this.healthErrorDetails;
    }

    /**
     * Set the healthErrorDetails property: The recovery services provider health error details.
     *
     * @param healthErrorDetails the healthErrorDetails value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withHealthErrorDetails(List<HealthError> healthErrorDetails) {
        this.healthErrorDetails = healthErrorDetails;
        return this;
    }

    /**
     * Get the draIdentifier property: The DRA Id.
     *
     * @return the draIdentifier value.
     */
    public String draIdentifier() {
        return this.draIdentifier;
    }

    /**
     * Set the draIdentifier property: The DRA Id.
     *
     * @param draIdentifier the draIdentifier value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withDraIdentifier(String draIdentifier) {
        this.draIdentifier = draIdentifier;
        return this;
    }

    /**
     * Get the machineId property: The machine Id.
     *
     * @return the machineId value.
     */
    public String machineId() {
        return this.machineId;
    }

    /**
     * Set the machineId property: The machine Id.
     *
     * @param machineId the machineId value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withMachineId(String machineId) {
        this.machineId = machineId;
        return this;
    }

    /**
     * Get the machineName property: The machine name.
     *
     * @return the machineName value.
     */
    public String machineName() {
        return this.machineName;
    }

    /**
     * Set the machineName property: The machine name.
     *
     * @param machineName the machineName value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withMachineName(String machineName) {
        this.machineName = machineName;
        return this;
    }

    /**
     * Get the biosId property: The Bios Id.
     *
     * @return the biosId value.
     */
    public String biosId() {
        return this.biosId;
    }

    /**
     * Set the biosId property: The Bios Id.
     *
     * @param biosId the biosId value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withBiosId(String biosId) {
        this.biosId = biosId;
        return this;
    }

    /**
     * Get the authenticationIdentityDetails property: The authentication identity details.
     *
     * @return the authenticationIdentityDetails value.
     */
    public IdentityProviderDetails authenticationIdentityDetails() {
        return this.authenticationIdentityDetails;
    }

    /**
     * Set the authenticationIdentityDetails property: The authentication identity details.
     *
     * @param authenticationIdentityDetails the authenticationIdentityDetails value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withAuthenticationIdentityDetails(
        IdentityProviderDetails authenticationIdentityDetails) {
        this.authenticationIdentityDetails = authenticationIdentityDetails;
        return this;
    }

    /**
     * Get the resourceAccessIdentityDetails property: The resource access identity details.
     *
     * @return the resourceAccessIdentityDetails value.
     */
    public IdentityProviderDetails resourceAccessIdentityDetails() {
        return this.resourceAccessIdentityDetails;
    }

    /**
     * Set the resourceAccessIdentityDetails property: The resource access identity details.
     *
     * @param resourceAccessIdentityDetails the resourceAccessIdentityDetails value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withResourceAccessIdentityDetails(
        IdentityProviderDetails resourceAccessIdentityDetails) {
        this.resourceAccessIdentityDetails = resourceAccessIdentityDetails;
        return this;
    }

    /**
     * Get the dataPlaneAuthenticationIdentityDetails property: The data plane authentication identity details.
     *
     * @return the dataPlaneAuthenticationIdentityDetails value.
     */
    public IdentityProviderDetails dataPlaneAuthenticationIdentityDetails() {
        return this.dataPlaneAuthenticationIdentityDetails;
    }

    /**
     * Set the dataPlaneAuthenticationIdentityDetails property: The data plane authentication identity details.
     *
     * @param dataPlaneAuthenticationIdentityDetails the dataPlaneAuthenticationIdentityDetails value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withDataPlaneAuthenticationIdentityDetails(
        IdentityProviderDetails dataPlaneAuthenticationIdentityDetails) {
        this.dataPlaneAuthenticationIdentityDetails = dataPlaneAuthenticationIdentityDetails;
        return this;
    }

    /**
     * Get the providerVersionDetails property: The provider version details.
     *
     * @return the providerVersionDetails value.
     */
    public VersionDetails providerVersionDetails() {
        return this.providerVersionDetails;
    }

    /**
     * Set the providerVersionDetails property: The provider version details.
     *
     * @param providerVersionDetails the providerVersionDetails value to set.
     * @return the RecoveryServicesProviderProperties object itself.
     */
    public RecoveryServicesProviderProperties withProviderVersionDetails(VersionDetails providerVersionDetails) {
        this.providerVersionDetails = providerVersionDetails;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (healthErrorDetails() != null) {
            healthErrorDetails().forEach(e -> e.validate());
        }
        if (authenticationIdentityDetails() != null) {
            authenticationIdentityDetails().validate();
        }
        if (resourceAccessIdentityDetails() != null) {
            resourceAccessIdentityDetails().validate();
        }
        if (dataPlaneAuthenticationIdentityDetails() != null) {
            dataPlaneAuthenticationIdentityDetails().validate();
        }
        if (providerVersionDetails() != null) {
            providerVersionDetails().validate();
        }
    }
}
