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

/** KPI Resource Health Details. */
@Fluent
public final class KpiResourceHealthDetails {
    /*
     * Resource Health Status
     */
    @JsonProperty(value = "resourceHealthStatus")
    private ResourceHealthStatus resourceHealthStatus;

    /*
     * Resource Health Status
     */
    @JsonProperty(value = "resourceHealthDetails")
    private List<ResourceHealthDetails> resourceHealthDetails;

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

    /**
     * Get the resourceHealthStatus property: Resource Health Status.
     *
     * @return the resourceHealthStatus value.
     */
    public ResourceHealthStatus resourceHealthStatus() {
        return this.resourceHealthStatus;
    }

    /**
     * Set the resourceHealthStatus property: Resource Health Status.
     *
     * @param resourceHealthStatus the resourceHealthStatus value to set.
     * @return the KpiResourceHealthDetails object itself.
     */
    public KpiResourceHealthDetails withResourceHealthStatus(ResourceHealthStatus resourceHealthStatus) {
        this.resourceHealthStatus = resourceHealthStatus;
        return this;
    }

    /**
     * Get the resourceHealthDetails property: Resource Health Status.
     *
     * @return the resourceHealthDetails value.
     */
    public List<ResourceHealthDetails> resourceHealthDetails() {
        return this.resourceHealthDetails;
    }

    /**
     * Set the resourceHealthDetails property: Resource Health Status.
     *
     * @param resourceHealthDetails the resourceHealthDetails value to set.
     * @return the KpiResourceHealthDetails object itself.
     */
    public KpiResourceHealthDetails withResourceHealthDetails(List<ResourceHealthDetails> resourceHealthDetails) {
        this.resourceHealthDetails = resourceHealthDetails;
        return this;
    }

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