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

package com.azure.resourcemanager.kusto.generated;

import com.azure.resourcemanager.kusto.models.AzureSku;
import com.azure.resourcemanager.kusto.models.AzureSkuName;
import com.azure.resourcemanager.kusto.models.AzureSkuTier;
import com.azure.resourcemanager.kusto.models.Identity;
import com.azure.resourcemanager.kusto.models.IdentityType;
import com.azure.resourcemanager.kusto.models.PublicIpType;
import com.azure.resourcemanager.kusto.models.PublicNetworkAccess;
import java.util.Arrays;

/** Samples for Clusters CreateOrUpdate. */
public final class ClustersCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/azure-kusto/resource-manager/Microsoft.Kusto/stable/2022-12-29/examples/KustoClustersCreateOrUpdate.json
     */
    /**
     * Sample code: KustoClustersCreateOrUpdate.
     *
     * @param manager Entry point to KustoManager.
     */
    public static void kustoClustersCreateOrUpdate(com.azure.resourcemanager.kusto.KustoManager manager) {
        manager
            .clusters()
            .define("kustoCluster")
            .withRegion("westus")
            .withExistingResourceGroup("kustorptest")
            .withSku(
                new AzureSku().withName(AzureSkuName.STANDARD_L16AS_V3).withCapacity(2).withTier(AzureSkuTier.STANDARD))
            .withIdentity(new Identity().withType(IdentityType.SYSTEM_ASSIGNED))
            .withEnableStreamingIngest(true)
            .withEnablePurge(true)
            .withEnableDoubleEncryption(false)
            .withPublicNetworkAccess(PublicNetworkAccess.ENABLED)
            .withAllowedIpRangeList(Arrays.asList("0.0.0.0/0"))
            .withEnableAutoStop(true)
            .withPublicIpType(PublicIpType.DUAL_STACK)
            .create();
    }
}
