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

package com.azure.resourcemanager.sql.generated;

import com.azure.core.util.Context;
import com.azure.resourcemanager.sql.fluent.models.DatabaseVulnerabilityAssessmentInner;
import com.azure.resourcemanager.sql.models.VulnerabilityAssessmentName;
import com.azure.resourcemanager.sql.models.VulnerabilityAssessmentRecurringScansProperties;
import java.util.Arrays;

/** Samples for ManagedDatabaseVulnerabilityAssessments CreateOrUpdate. */
public final class ManagedDatabaseVulnerabilityAssessmentsCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2021-11-01/examples/ManagedDatabaseVulnerabilityAssessmentCreateMax.json
     */
    /**
     * Sample code: Create a database's vulnerability assessment with all parameters.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void createADatabaseSVulnerabilityAssessmentWithAllParameters(
        com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .sqlServers()
            .manager()
            .serviceClient()
            .getManagedDatabaseVulnerabilityAssessments()
            .createOrUpdateWithResponse(
                "vulnerabilityaseessmenttest-4799",
                "vulnerabilityaseessmenttest-6440",
                "testdb",
                VulnerabilityAssessmentName.DEFAULT,
                new DatabaseVulnerabilityAssessmentInner()
                    .withStorageContainerPath("https://myStorage.blob.core.windows.net/vulnerability-assessment/")
                    .withStorageContainerSasKey("fakeTokenPlaceholder")
                    .withRecurringScans(
                        new VulnerabilityAssessmentRecurringScansProperties()
                            .withIsEnabled(true)
                            .withEmailSubscriptionAdmins(true)
                            .withEmails(Arrays.asList("email1@mail.com", "email2@mail.com"))),
                Context.NONE);
    }

    /*
     * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2021-11-01/examples/ManagedDatabaseVulnerabilityAssessmentCreateMin.json
     */
    /**
     * Sample code: Create a database's vulnerability assessment with minimal parameters.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void createADatabaseSVulnerabilityAssessmentWithMinimalParameters(
        com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .sqlServers()
            .manager()
            .serviceClient()
            .getManagedDatabaseVulnerabilityAssessments()
            .createOrUpdateWithResponse(
                "vulnerabilityaseessmenttest-4799",
                "vulnerabilityaseessmenttest-6440",
                "testdb",
                VulnerabilityAssessmentName.DEFAULT,
                new DatabaseVulnerabilityAssessmentInner()
                    .withStorageContainerPath("https://myStorage.blob.core.windows.net/vulnerability-assessment/")
                    .withStorageContainerSasKey("fakeTokenPlaceholder"),
                Context.NONE);
    }
}
