// 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.VulnerabilityAssessmentName;
import com.azure.resourcemanager.synapse.models.VulnerabilityAssessmentRecurringScansProperties;
import java.util.Arrays;

/** Samples for SqlPoolVulnerabilityAssessments CreateOrUpdate. */
public final class SqlPoolVulnerabilityAssessmentsCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolVulnerabilityAssessmentWithContainerSasKeyAndMinParameters.json
     */
    /**
     * Sample code: Create a database's vulnerability assessment with minimal parameters, when storageContainerSasKey is
     * specified.
     *
     * @param manager Entry point to SynapseManager.
     */
    public static void
        createADatabaseSVulnerabilityAssessmentWithMinimalParametersWhenStorageContainerSasKeyIsSpecified(
            com.azure.resourcemanager.synapse.SynapseManager manager) {
        manager
            .sqlPoolVulnerabilityAssessments()
            .define(VulnerabilityAssessmentName.DEFAULT)
            .withExistingSqlPool("vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb")
            .withStorageContainerPath("https://myStorage.blob.core.windows.net/vulnerability-assessment/")
            .withStorageContainerSasKey("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
            .create();
    }

    /*
     * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateSqlPoolVulnerabilityAssessmentWithAllParameters.json
     */
    /**
     * Sample code: Create a database's vulnerability assessment with all parameters.
     *
     * @param manager Entry point to SynapseManager.
     */
    public static void createADatabaseSVulnerabilityAssessmentWithAllParameters(
        com.azure.resourcemanager.synapse.SynapseManager manager) {
        manager
            .sqlPoolVulnerabilityAssessments()
            .define(VulnerabilityAssessmentName.DEFAULT)
            .withExistingSqlPool("vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb")
            .withStorageContainerPath("https://myStorage.blob.core.windows.net/vulnerability-assessment/")
            .withStorageContainerSasKey("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
            .withStorageAccountAccessKey("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
            .withRecurringScans(
                new VulnerabilityAssessmentRecurringScansProperties()
                    .withIsEnabled(true)
                    .withEmailSubscriptionAdmins(true)
                    .withEmails(Arrays.asList("email1@mail.com", "email2@mail.com")))
            .create();
    }

    /*
     * x-ms-original-file: specification/synapse/resource-manager/Microsoft.Synapse/stable/2021-06-01/examples/CreateOrUpdateVulnerabilityAssessmentWithStorageAccessKeyAndMinParameters.json
     */
    /**
     * Sample code: Create a database's vulnerability assessment with minimal parameters, when storageAccountAccessKey
     * is specified.
     *
     * @param manager Entry point to SynapseManager.
     */
    public static void
        createADatabaseSVulnerabilityAssessmentWithMinimalParametersWhenStorageAccountAccessKeyIsSpecified(
            com.azure.resourcemanager.synapse.SynapseManager manager) {
        manager
            .sqlPoolVulnerabilityAssessments()
            .define(VulnerabilityAssessmentName.DEFAULT)
            .withExistingSqlPool("vulnerabilityaseessmenttest-4799", "vulnerabilityaseessmenttest-6440", "testdb")
            .withStorageContainerPath("https://myStorage.blob.core.windows.net/vulnerability-assessment/")
            .withStorageAccountAccessKey("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
            .create();
    }
}
