// 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.util.List;

/** Fabric properties. */
@Fluent
public final class FabricProperties {
    /*
     * Friendly name of the fabric.
     */
    @JsonProperty(value = "friendlyName")
    private String friendlyName;

    /*
     * Encryption details for the fabric.
     */
    @JsonProperty(value = "encryptionDetails")
    private EncryptionDetails encryptionDetails;

    /*
     * Rollover encryption details for the fabric.
     */
    @JsonProperty(value = "rolloverEncryptionDetails")
    private EncryptionDetails rolloverEncryptionDetails;

    /*
     * Dra Registration Id.
     */
    @JsonProperty(value = "internalIdentifier")
    private String internalIdentifier;

    /*
     * BCDR state of the fabric.
     */
    @JsonProperty(value = "bcdrState")
    private String bcdrState;

    /*
     * Fabric specific settings.
     */
    @JsonProperty(value = "customDetails")
    private FabricSpecificDetails customDetails;

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

    /*
     * Health of fabric.
     */
    @JsonProperty(value = "health")
    private String health;

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

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

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

    /**
     * Get the encryptionDetails property: Encryption details for the fabric.
     *
     * @return the encryptionDetails value.
     */
    public EncryptionDetails encryptionDetails() {
        return this.encryptionDetails;
    }

    /**
     * Set the encryptionDetails property: Encryption details for the fabric.
     *
     * @param encryptionDetails the encryptionDetails value to set.
     * @return the FabricProperties object itself.
     */
    public FabricProperties withEncryptionDetails(EncryptionDetails encryptionDetails) {
        this.encryptionDetails = encryptionDetails;
        return this;
    }

    /**
     * Get the rolloverEncryptionDetails property: Rollover encryption details for the fabric.
     *
     * @return the rolloverEncryptionDetails value.
     */
    public EncryptionDetails rolloverEncryptionDetails() {
        return this.rolloverEncryptionDetails;
    }

    /**
     * Set the rolloverEncryptionDetails property: Rollover encryption details for the fabric.
     *
     * @param rolloverEncryptionDetails the rolloverEncryptionDetails value to set.
     * @return the FabricProperties object itself.
     */
    public FabricProperties withRolloverEncryptionDetails(EncryptionDetails rolloverEncryptionDetails) {
        this.rolloverEncryptionDetails = rolloverEncryptionDetails;
        return this;
    }

    /**
     * Get the internalIdentifier property: Dra Registration Id.
     *
     * @return the internalIdentifier value.
     */
    public String internalIdentifier() {
        return this.internalIdentifier;
    }

    /**
     * Set the internalIdentifier property: Dra Registration Id.
     *
     * @param internalIdentifier the internalIdentifier value to set.
     * @return the FabricProperties object itself.
     */
    public FabricProperties withInternalIdentifier(String internalIdentifier) {
        this.internalIdentifier = internalIdentifier;
        return this;
    }

    /**
     * Get the bcdrState property: BCDR state of the fabric.
     *
     * @return the bcdrState value.
     */
    public String bcdrState() {
        return this.bcdrState;
    }

    /**
     * Set the bcdrState property: BCDR state of the fabric.
     *
     * @param bcdrState the bcdrState value to set.
     * @return the FabricProperties object itself.
     */
    public FabricProperties withBcdrState(String bcdrState) {
        this.bcdrState = bcdrState;
        return this;
    }

    /**
     * Get the customDetails property: Fabric specific settings.
     *
     * @return the customDetails value.
     */
    public FabricSpecificDetails customDetails() {
        return this.customDetails;
    }

    /**
     * Set the customDetails property: Fabric specific settings.
     *
     * @param customDetails the customDetails value to set.
     * @return the FabricProperties object itself.
     */
    public FabricProperties withCustomDetails(FabricSpecificDetails customDetails) {
        this.customDetails = customDetails;
        return this;
    }

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

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

    /**
     * Get the health property: Health of fabric.
     *
     * @return the health value.
     */
    public String health() {
        return this.health;
    }

    /**
     * Set the health property: Health of fabric.
     *
     * @param health the health value to set.
     * @return the FabricProperties object itself.
     */
    public FabricProperties withHealth(String health) {
        this.health = health;
        return this;
    }

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