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

package com.azure.resourcemanager.appplatform.generated;

import com.azure.core.util.Context;
import com.azure.resourcemanager.appplatform.fluent.models.GatewayResourceInner;
import com.azure.resourcemanager.appplatform.models.GatewayProperties;
import com.azure.resourcemanager.appplatform.models.GatewayResourceRequests;
import com.azure.resourcemanager.appplatform.models.Sku;

/** Samples for Gateways CreateOrUpdate. */
public final class GatewaysCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-12-01/examples/Gateways_CreateOrUpdate.json
     */
    /**
     * Sample code: Gateways_CreateOrUpdate.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void gatewaysCreateOrUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .springServices()
            .manager()
            .serviceClient()
            .getGateways()
            .createOrUpdate(
                "myResourceGroup",
                "myservice",
                "default",
                new GatewayResourceInner()
                    .withProperties(
                        new GatewayProperties()
                            .withPublicProperty(true)
                            .withResourceRequests(new GatewayResourceRequests().withCpu("1").withMemory("1G")))
                    .withSku(new Sku().withName("E0").withTier("Enterprise").withCapacity(2)),
                Context.NONE);
    }
}
