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

package com.azure.resourcemanager.synapse.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentRuleBaselineItem;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Properties of a Sql pool vulnerability assessment rule baseline. */
@Fluent
public final class SqlPoolVulnerabilityAssessmentRuleBaselineProperties {
    /*
     * The rule baseline result
     */
    @JsonProperty(value = "baselineResults", required = true)
    private List<SqlPoolVulnerabilityAssessmentRuleBaselineItem> baselineResults;

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

    /**
     * Get the baselineResults property: The rule baseline result.
     *
     * @return the baselineResults value.
     */
    public List<SqlPoolVulnerabilityAssessmentRuleBaselineItem> baselineResults() {
        return this.baselineResults;
    }

    /**
     * Set the baselineResults property: The rule baseline result.
     *
     * @param baselineResults the baselineResults value to set.
     * @return the SqlPoolVulnerabilityAssessmentRuleBaselineProperties object itself.
     */
    public SqlPoolVulnerabilityAssessmentRuleBaselineProperties withBaselineResults(
        List<SqlPoolVulnerabilityAssessmentRuleBaselineItem> baselineResults) {
        this.baselineResults = baselineResults;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (baselineResults() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property baselineResults in model"
                            + " SqlPoolVulnerabilityAssessmentRuleBaselineProperties"));
        } else {
            baselineResults().forEach(e -> e.validate());
        }
    }

    private static final ClientLogger LOGGER =
        new ClientLogger(SqlPoolVulnerabilityAssessmentRuleBaselineProperties.class);
}
