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

/** Replication protected item custom data details. */
@Fluent
public final class ReplicationProtectedItemProperties {
    /*
     * The name.
     */
    @JsonProperty(value = "friendlyName")
    private String friendlyName;

    /*
     * The type of protected item type.
     */
    @JsonProperty(value = "protectedItemType")
    private String protectedItemType;

    /*
     * The protected item ARM Id.
     */
    @JsonProperty(value = "protectableItemId")
    private String protectableItemId;

    /*
     * The recovery provider ARM Id.
     */
    @JsonProperty(value = "recoveryServicesProviderId")
    private String recoveryServicesProviderId;

    /*
     * The friendly name of the primary fabric.
     */
    @JsonProperty(value = "primaryFabricFriendlyName")
    private String primaryFabricFriendlyName;

    /*
     * The fabric provider of the primary fabric.
     */
    @JsonProperty(value = "primaryFabricProvider")
    private String primaryFabricProvider;

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

    /*
     * The Arm Id of recovery fabric.
     */
    @JsonProperty(value = "recoveryFabricId")
    private String recoveryFabricId;

    /*
     * The name of primary protection container friendly name.
     */
    @JsonProperty(value = "primaryProtectionContainerFriendlyName")
    private String primaryProtectionContainerFriendlyName;

    /*
     * The name of recovery container friendly name.
     */
    @JsonProperty(value = "recoveryProtectionContainerFriendlyName")
    private String recoveryProtectionContainerFriendlyName;

    /*
     * The protection status.
     */
    @JsonProperty(value = "protectionState")
    private String protectionState;

    /*
     * The protection state description.
     */
    @JsonProperty(value = "protectionStateDescription")
    private String protectionStateDescription;

    /*
     * The Current active location of the PE.
     */
    @JsonProperty(value = "activeLocation")
    private String activeLocation;

    /*
     * The Test failover state.
     */
    @JsonProperty(value = "testFailoverState")
    private String testFailoverState;

    /*
     * The Test failover state description.
     */
    @JsonProperty(value = "testFailoverStateDescription")
    private String testFailoverStateDescription;

    /*
     * The switch provider state.
     */
    @JsonProperty(value = "switchProviderState")
    private String switchProviderState;

    /*
     * The switch provider state description.
     */
    @JsonProperty(value = "switchProviderStateDescription")
    private String switchProviderStateDescription;

    /*
     * The allowed operations on the Replication protected item.
     */
    @JsonProperty(value = "allowedOperations")
    private List<String> allowedOperations;

    /*
     * The consolidated protection health for the VM taking any issues with SRS as well as all the replication units
     * associated with the VM's replication group into account. This is a string representation of the ProtectionHealth
     * enumeration.
     */
    @JsonProperty(value = "replicationHealth")
    private String replicationHealth;

    /*
     * The consolidated failover health for the VM.
     */
    @JsonProperty(value = "failoverHealth")
    private String failoverHealth;

    /*
     * List of health errors.
     */
    @JsonProperty(value = "healthErrors")
    private List<HealthError> healthErrors;

    /*
     * The ID of Policy governing this PE.
     */
    @JsonProperty(value = "policyId")
    private String policyId;

    /*
     * The name of Policy governing this PE.
     */
    @JsonProperty(value = "policyFriendlyName")
    private String policyFriendlyName;

    /*
     * The Last successful failover time.
     */
    @JsonProperty(value = "lastSuccessfulFailoverTime")
    private OffsetDateTime lastSuccessfulFailoverTime;

    /*
     * The Last successful test failover time.
     */
    @JsonProperty(value = "lastSuccessfulTestFailoverTime")
    private OffsetDateTime lastSuccessfulTestFailoverTime;

    /*
     * The current scenario.
     */
    @JsonProperty(value = "currentScenario")
    private CurrentScenarioDetails currentScenario;

    /*
     * The recovery point ARM Id to which the Vm was failed over.
     */
    @JsonProperty(value = "failoverRecoveryPointId")
    private String failoverRecoveryPointId;

    /*
     * The Replication provider custom settings.
     */
    @JsonProperty(value = "providerSpecificDetails")
    private ReplicationProviderSpecificSettings providerSpecificDetails;

    /*
     * The recovery container Id.
     */
    @JsonProperty(value = "recoveryContainerId")
    private String recoveryContainerId;

    /*
     * The correlation Id for events associated with this protected item.
     */
    @JsonProperty(value = "eventCorrelationId")
    private String eventCorrelationId;

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

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

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

    /**
     * Get the protectedItemType property: The type of protected item type.
     *
     * @return the protectedItemType value.
     */
    public String protectedItemType() {
        return this.protectedItemType;
    }

    /**
     * Set the protectedItemType property: The type of protected item type.
     *
     * @param protectedItemType the protectedItemType value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withProtectedItemType(String protectedItemType) {
        this.protectedItemType = protectedItemType;
        return this;
    }

    /**
     * Get the protectableItemId property: The protected item ARM Id.
     *
     * @return the protectableItemId value.
     */
    public String protectableItemId() {
        return this.protectableItemId;
    }

    /**
     * Set the protectableItemId property: The protected item ARM Id.
     *
     * @param protectableItemId the protectableItemId value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withProtectableItemId(String protectableItemId) {
        this.protectableItemId = protectableItemId;
        return this;
    }

    /**
     * Get the recoveryServicesProviderId property: The recovery provider ARM Id.
     *
     * @return the recoveryServicesProviderId value.
     */
    public String recoveryServicesProviderId() {
        return this.recoveryServicesProviderId;
    }

    /**
     * Set the recoveryServicesProviderId property: The recovery provider ARM Id.
     *
     * @param recoveryServicesProviderId the recoveryServicesProviderId value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withRecoveryServicesProviderId(String recoveryServicesProviderId) {
        this.recoveryServicesProviderId = recoveryServicesProviderId;
        return this;
    }

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

    /**
     * Set the primaryFabricFriendlyName property: The friendly name of the primary fabric.
     *
     * @param primaryFabricFriendlyName the primaryFabricFriendlyName value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withPrimaryFabricFriendlyName(String primaryFabricFriendlyName) {
        this.primaryFabricFriendlyName = primaryFabricFriendlyName;
        return this;
    }

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

    /**
     * Set the primaryFabricProvider property: The fabric provider of the primary fabric.
     *
     * @param primaryFabricProvider the primaryFabricProvider value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withPrimaryFabricProvider(String primaryFabricProvider) {
        this.primaryFabricProvider = primaryFabricProvider;
        return this;
    }

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

    /**
     * Set the recoveryFabricFriendlyName property: The friendly name of recovery fabric.
     *
     * @param recoveryFabricFriendlyName the recoveryFabricFriendlyName value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withRecoveryFabricFriendlyName(String recoveryFabricFriendlyName) {
        this.recoveryFabricFriendlyName = recoveryFabricFriendlyName;
        return this;
    }

    /**
     * Get the recoveryFabricId property: The Arm Id of recovery fabric.
     *
     * @return the recoveryFabricId value.
     */
    public String recoveryFabricId() {
        return this.recoveryFabricId;
    }

    /**
     * Set the recoveryFabricId property: The Arm Id of recovery fabric.
     *
     * @param recoveryFabricId the recoveryFabricId value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withRecoveryFabricId(String recoveryFabricId) {
        this.recoveryFabricId = recoveryFabricId;
        return this;
    }

    /**
     * Get the primaryProtectionContainerFriendlyName property: The name of primary protection container friendly name.
     *
     * @return the primaryProtectionContainerFriendlyName value.
     */
    public String primaryProtectionContainerFriendlyName() {
        return this.primaryProtectionContainerFriendlyName;
    }

    /**
     * Set the primaryProtectionContainerFriendlyName property: The name of primary protection container friendly name.
     *
     * @param primaryProtectionContainerFriendlyName the primaryProtectionContainerFriendlyName value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withPrimaryProtectionContainerFriendlyName(
        String primaryProtectionContainerFriendlyName) {
        this.primaryProtectionContainerFriendlyName = primaryProtectionContainerFriendlyName;
        return this;
    }

    /**
     * Get the recoveryProtectionContainerFriendlyName property: The name of recovery container friendly name.
     *
     * @return the recoveryProtectionContainerFriendlyName value.
     */
    public String recoveryProtectionContainerFriendlyName() {
        return this.recoveryProtectionContainerFriendlyName;
    }

    /**
     * Set the recoveryProtectionContainerFriendlyName property: The name of recovery container friendly name.
     *
     * @param recoveryProtectionContainerFriendlyName the recoveryProtectionContainerFriendlyName value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withRecoveryProtectionContainerFriendlyName(
        String recoveryProtectionContainerFriendlyName) {
        this.recoveryProtectionContainerFriendlyName = recoveryProtectionContainerFriendlyName;
        return this;
    }

    /**
     * Get the protectionState property: The protection status.
     *
     * @return the protectionState value.
     */
    public String protectionState() {
        return this.protectionState;
    }

    /**
     * Set the protectionState property: The protection status.
     *
     * @param protectionState the protectionState value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withProtectionState(String protectionState) {
        this.protectionState = protectionState;
        return this;
    }

    /**
     * Get the protectionStateDescription property: The protection state description.
     *
     * @return the protectionStateDescription value.
     */
    public String protectionStateDescription() {
        return this.protectionStateDescription;
    }

    /**
     * Set the protectionStateDescription property: The protection state description.
     *
     * @param protectionStateDescription the protectionStateDescription value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withProtectionStateDescription(String protectionStateDescription) {
        this.protectionStateDescription = protectionStateDescription;
        return this;
    }

    /**
     * Get the activeLocation property: The Current active location of the PE.
     *
     * @return the activeLocation value.
     */
    public String activeLocation() {
        return this.activeLocation;
    }

    /**
     * Set the activeLocation property: The Current active location of the PE.
     *
     * @param activeLocation the activeLocation value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withActiveLocation(String activeLocation) {
        this.activeLocation = activeLocation;
        return this;
    }

    /**
     * Get the testFailoverState property: The Test failover state.
     *
     * @return the testFailoverState value.
     */
    public String testFailoverState() {
        return this.testFailoverState;
    }

    /**
     * Set the testFailoverState property: The Test failover state.
     *
     * @param testFailoverState the testFailoverState value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withTestFailoverState(String testFailoverState) {
        this.testFailoverState = testFailoverState;
        return this;
    }

    /**
     * Get the testFailoverStateDescription property: The Test failover state description.
     *
     * @return the testFailoverStateDescription value.
     */
    public String testFailoverStateDescription() {
        return this.testFailoverStateDescription;
    }

    /**
     * Set the testFailoverStateDescription property: The Test failover state description.
     *
     * @param testFailoverStateDescription the testFailoverStateDescription value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withTestFailoverStateDescription(String testFailoverStateDescription) {
        this.testFailoverStateDescription = testFailoverStateDescription;
        return this;
    }

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

    /**
     * Set the switchProviderState property: The switch provider state.
     *
     * @param switchProviderState the switchProviderState value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withSwitchProviderState(String switchProviderState) {
        this.switchProviderState = switchProviderState;
        return this;
    }

    /**
     * Get the switchProviderStateDescription property: The switch provider state description.
     *
     * @return the switchProviderStateDescription value.
     */
    public String switchProviderStateDescription() {
        return this.switchProviderStateDescription;
    }

    /**
     * Set the switchProviderStateDescription property: The switch provider state description.
     *
     * @param switchProviderStateDescription the switchProviderStateDescription value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withSwitchProviderStateDescription(
        String switchProviderStateDescription) {
        this.switchProviderStateDescription = switchProviderStateDescription;
        return this;
    }

    /**
     * Get the allowedOperations property: The allowed operations on the Replication protected item.
     *
     * @return the allowedOperations value.
     */
    public List<String> allowedOperations() {
        return this.allowedOperations;
    }

    /**
     * Set the allowedOperations property: The allowed operations on the Replication protected item.
     *
     * @param allowedOperations the allowedOperations value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withAllowedOperations(List<String> allowedOperations) {
        this.allowedOperations = allowedOperations;
        return this;
    }

    /**
     * Get the replicationHealth property: The consolidated protection health for the VM taking any issues with SRS as
     * well as all the replication units associated with the VM's replication group into account. This is a string
     * representation of the ProtectionHealth enumeration.
     *
     * @return the replicationHealth value.
     */
    public String replicationHealth() {
        return this.replicationHealth;
    }

    /**
     * Set the replicationHealth property: The consolidated protection health for the VM taking any issues with SRS as
     * well as all the replication units associated with the VM's replication group into account. This is a string
     * representation of the ProtectionHealth enumeration.
     *
     * @param replicationHealth the replicationHealth value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withReplicationHealth(String replicationHealth) {
        this.replicationHealth = replicationHealth;
        return this;
    }

    /**
     * Get the failoverHealth property: The consolidated failover health for the VM.
     *
     * @return the failoverHealth value.
     */
    public String failoverHealth() {
        return this.failoverHealth;
    }

    /**
     * Set the failoverHealth property: The consolidated failover health for the VM.
     *
     * @param failoverHealth the failoverHealth value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withFailoverHealth(String failoverHealth) {
        this.failoverHealth = failoverHealth;
        return this;
    }

    /**
     * Get the healthErrors property: List of health errors.
     *
     * @return the healthErrors value.
     */
    public List<HealthError> healthErrors() {
        return this.healthErrors;
    }

    /**
     * Set the healthErrors property: List of health errors.
     *
     * @param healthErrors the healthErrors value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withHealthErrors(List<HealthError> healthErrors) {
        this.healthErrors = healthErrors;
        return this;
    }

    /**
     * Get the policyId property: The ID of Policy governing this PE.
     *
     * @return the policyId value.
     */
    public String policyId() {
        return this.policyId;
    }

    /**
     * Set the policyId property: The ID of Policy governing this PE.
     *
     * @param policyId the policyId value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withPolicyId(String policyId) {
        this.policyId = policyId;
        return this;
    }

    /**
     * Get the policyFriendlyName property: The name of Policy governing this PE.
     *
     * @return the policyFriendlyName value.
     */
    public String policyFriendlyName() {
        return this.policyFriendlyName;
    }

    /**
     * Set the policyFriendlyName property: The name of Policy governing this PE.
     *
     * @param policyFriendlyName the policyFriendlyName value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withPolicyFriendlyName(String policyFriendlyName) {
        this.policyFriendlyName = policyFriendlyName;
        return this;
    }

    /**
     * Get the lastSuccessfulFailoverTime property: The Last successful failover time.
     *
     * @return the lastSuccessfulFailoverTime value.
     */
    public OffsetDateTime lastSuccessfulFailoverTime() {
        return this.lastSuccessfulFailoverTime;
    }

    /**
     * Set the lastSuccessfulFailoverTime property: The Last successful failover time.
     *
     * @param lastSuccessfulFailoverTime the lastSuccessfulFailoverTime value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withLastSuccessfulFailoverTime(
        OffsetDateTime lastSuccessfulFailoverTime) {
        this.lastSuccessfulFailoverTime = lastSuccessfulFailoverTime;
        return this;
    }

    /**
     * Get the lastSuccessfulTestFailoverTime property: The Last successful test failover time.
     *
     * @return the lastSuccessfulTestFailoverTime value.
     */
    public OffsetDateTime lastSuccessfulTestFailoverTime() {
        return this.lastSuccessfulTestFailoverTime;
    }

    /**
     * Set the lastSuccessfulTestFailoverTime property: The Last successful test failover time.
     *
     * @param lastSuccessfulTestFailoverTime the lastSuccessfulTestFailoverTime value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withLastSuccessfulTestFailoverTime(
        OffsetDateTime lastSuccessfulTestFailoverTime) {
        this.lastSuccessfulTestFailoverTime = lastSuccessfulTestFailoverTime;
        return this;
    }

    /**
     * Get the currentScenario property: The current scenario.
     *
     * @return the currentScenario value.
     */
    public CurrentScenarioDetails currentScenario() {
        return this.currentScenario;
    }

    /**
     * Set the currentScenario property: The current scenario.
     *
     * @param currentScenario the currentScenario value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withCurrentScenario(CurrentScenarioDetails currentScenario) {
        this.currentScenario = currentScenario;
        return this;
    }

    /**
     * Get the failoverRecoveryPointId property: The recovery point ARM Id to which the Vm was failed over.
     *
     * @return the failoverRecoveryPointId value.
     */
    public String failoverRecoveryPointId() {
        return this.failoverRecoveryPointId;
    }

    /**
     * Set the failoverRecoveryPointId property: The recovery point ARM Id to which the Vm was failed over.
     *
     * @param failoverRecoveryPointId the failoverRecoveryPointId value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withFailoverRecoveryPointId(String failoverRecoveryPointId) {
        this.failoverRecoveryPointId = failoverRecoveryPointId;
        return this;
    }

    /**
     * Get the providerSpecificDetails property: The Replication provider custom settings.
     *
     * @return the providerSpecificDetails value.
     */
    public ReplicationProviderSpecificSettings providerSpecificDetails() {
        return this.providerSpecificDetails;
    }

    /**
     * Set the providerSpecificDetails property: The Replication provider custom settings.
     *
     * @param providerSpecificDetails the providerSpecificDetails value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withProviderSpecificDetails(
        ReplicationProviderSpecificSettings providerSpecificDetails) {
        this.providerSpecificDetails = providerSpecificDetails;
        return this;
    }

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

    /**
     * Set the recoveryContainerId property: The recovery container Id.
     *
     * @param recoveryContainerId the recoveryContainerId value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withRecoveryContainerId(String recoveryContainerId) {
        this.recoveryContainerId = recoveryContainerId;
        return this;
    }

    /**
     * Get the eventCorrelationId property: The correlation Id for events associated with this protected item.
     *
     * @return the eventCorrelationId value.
     */
    public String eventCorrelationId() {
        return this.eventCorrelationId;
    }

    /**
     * Set the eventCorrelationId property: The correlation Id for events associated with this protected item.
     *
     * @param eventCorrelationId the eventCorrelationId value to set.
     * @return the ReplicationProtectedItemProperties object itself.
     */
    public ReplicationProtectedItemProperties withEventCorrelationId(String eventCorrelationId) {
        this.eventCorrelationId = eventCorrelationId;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (healthErrors() != null) {
            healthErrors().forEach(e -> e.validate());
        }
        if (currentScenario() != null) {
            currentScenario().validate();
        }
        if (providerSpecificDetails() != null) {
            providerSpecificDetails().validate();
        }
    }
}
