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

import com.azure.resourcemanager.synapse.models.SqlPoolVulnerabilityAssessmentRuleBaselineItem;
import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentName;
import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentPolicyBaselineName;
import java.util.Arrays;

/** Samples for SqlPoolVulnerabilityAssessmentRuleBaselines CreateOrUpdate. */
public final class SqlPoolVulnerabilityAssessmentRuleBaselinesCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolVulnerabilityAssessmentRuleBaseline.json
     */
    /**
     * Sample code: Creates or updates a database's vulnerability assessment rule baseline.
     *
     * @param manager Entry point to SynapseManager.
     */
    public static void createsOrUpdatesADatabaseSVulnerabilityAssessmentRuleBaseline(
        com.azure.resourcemanager.synapse.SynapseManager manager) {
        manager
            .sqlPoolVulnerabilityAssessmentRuleBaselines()
            .define(VulnerabilityAssessmentPolicyBaselineName.DEFAULT)
            .withExistingRule(
                "vulnerabilityaseessmenttest-4799",
                "vulnerabilityaseessmenttest-6440",
                "testdb",
                VulnerabilityAssessmentName.DEFAULT,
                "VA1001")
            .withBaselineResults(
                Arrays
                    .asList(
                        new SqlPoolVulnerabilityAssessmentRuleBaselineItem()
                            .withResult(Arrays.asList("userA", "SELECT")),
                        new SqlPoolVulnerabilityAssessmentRuleBaselineItem()
                            .withResult(Arrays.asList("userB", "SELECT")),
                        new SqlPoolVulnerabilityAssessmentRuleBaselineItem()
                            .withResult(Arrays.asList("userC", "SELECT", "tableId_4"))))
            .create();
    }
}
