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

package com.azure.resourcemanager.apimanagement.generated;

import com.azure.core.util.Context;
import com.azure.resourcemanager.apimanagement.models.ApiContract;

/** Samples for Api Update. */
public final class ApiUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApi.json
     */
    /**
     * Sample code: ApiManagementUpdateApi.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateApi(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        ApiContract resource =
            manager.apis().getWithResponse("rg1", "apimService1", "echo-api", Context.NONE).getValue();
        resource
            .update()
            .withDisplayName("Echo API New")
            .withServiceUrl("http://echoapi.cloudapp.net/api2")
            .withPath("newecho")
            .withIfMatch("*")
            .apply();
    }
}
