// 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.ServerDevOpsAuditingSettingsInner;
import com.azure.resourcemanager.sql.models.BlobAuditingPolicyState;
import java.util.UUID;

/** Samples for ServerDevOpsAuditSettings CreateOrUpdate. */
public final class ServerDevOpsAuditSettingsCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2021-11-01/examples/ServerDevOpsAuditCreateMin.json
     */
    /**
     * Sample code: Update a server's DevOps audit settings with minimal input.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void updateAServerSDevOpsAuditSettingsWithMinimalInput(
        com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .sqlServers()
            .manager()
            .serviceClient()
            .getServerDevOpsAuditSettings()
            .createOrUpdate(
                "devAuditTestRG",
                "devOpsAuditTestSvr",
                "default",
                new ServerDevOpsAuditingSettingsInner()
                    .withState(BlobAuditingPolicyState.ENABLED)
                    .withStorageEndpoint("https://mystorage.blob.core.windows.net")
                    .withStorageAccountAccessKey("fakeTokenPlaceholder"),
                Context.NONE);
    }

    /*
     * x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2021-11-01/examples/ServerDevOpsAuditCreateMax.json
     */
    /**
     * Sample code: Update a server's DevOps audit settings with all params.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void updateAServerSDevOpsAuditSettingsWithAllParams(
        com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .sqlServers()
            .manager()
            .serviceClient()
            .getServerDevOpsAuditSettings()
            .createOrUpdate(
                "devAuditTestRG",
                "devOpsAuditTestSvr",
                "default",
                new ServerDevOpsAuditingSettingsInner()
                    .withIsAzureMonitorTargetEnabled(true)
                    .withState(BlobAuditingPolicyState.ENABLED)
                    .withStorageEndpoint("https://mystorage.blob.core.windows.net")
                    .withStorageAccountAccessKey("fakeTokenPlaceholder")
                    .withStorageAccountSubscriptionId(UUID.fromString("00000000-1234-0000-5678-000000000000")),
                Context.NONE);
    }
}
