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

package com.azure.resourcemanager.security.generated;

import java.util.Arrays;

/** Samples for SqlVulnerabilityAssessmentBaselineRules CreateOrUpdate. */
public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json
     */
    /**
     * Sample code: Create a baseline using the latest scan results.
     *
     * @param manager Entry point to SecurityManager.
     */
    public static void createABaselineUsingTheLatestScanResults(
        com.azure.resourcemanager.security.SecurityManager manager) {
        manager
            .sqlVulnerabilityAssessmentBaselineRules()
            .define("VA1234")
            .withExistingResourceId(
                "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master")
            .withLatestScan(true)
            .withResults(Arrays.asList())
            .withWorkspaceId("55555555-6666-7777-8888-999999999999")
            .create();
    }

    /*
     * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json
     */
    /**
     * Sample code: Create a baseline.
     *
     * @param manager Entry point to SecurityManager.
     */
    public static void createABaseline(com.azure.resourcemanager.security.SecurityManager manager) {
        manager
            .sqlVulnerabilityAssessmentBaselineRules()
            .define("VA1234")
            .withExistingResourceId(
                "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master")
            .withLatestScan(false)
            .withResults(Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT")))
            .withWorkspaceId("55555555-6666-7777-8888-999999999999")
            .create();
    }
}
