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

package com.azure.resourcemanager.devcenter.generated;

import com.azure.resourcemanager.devcenter.models.LicenseType;
import com.azure.resourcemanager.devcenter.models.LocalAdminStatus;
import com.azure.resourcemanager.devcenter.models.StopOnDisconnectConfiguration;
import com.azure.resourcemanager.devcenter.models.StopOnDisconnectEnableStatus;

/** Samples for Pools CreateOrUpdate. */
public final class PoolsCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/devcenter/resource-manager/Microsoft.DevCenter/stable/2023-04-01/examples/Pools_Put.json
     */
    /**
     * Sample code: Pools_CreateOrUpdate.
     *
     * @param manager Entry point to DevCenterManager.
     */
    public static void poolsCreateOrUpdate(com.azure.resourcemanager.devcenter.DevCenterManager manager) {
        manager
            .pools()
            .define("DevPool")
            .withRegion("centralus")
            .withExistingProject("rg1", "DevProject")
            .withDevBoxDefinitionName("WebDevBox")
            .withNetworkConnectionName("Network1-westus2")
            .withLicenseType(LicenseType.WINDOWS_CLIENT)
            .withLocalAdministrator(LocalAdminStatus.ENABLED)
            .withStopOnDisconnect(
                new StopOnDisconnectConfiguration()
                    .withStatus(StopOnDisconnectEnableStatus.ENABLED)
                    .withGracePeriodMinutes(60))
            .create();
    }
}
