// 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.NamedValueContract;
import java.util.Arrays;

/** Samples for NamedValue Update. */
public final class NamedValueUpdateSamples {
    /*
     * x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateNamedValue.json
     */
    /**
     * Sample code: ApiManagementUpdateNamedValue.
     *
     * @param manager Entry point to ApiManagementManager.
     */
    public static void apiManagementUpdateNamedValue(
        com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
        NamedValueContract resource =
            manager.namedValues().getWithResponse("rg1", "apimService1", "testprop2", Context.NONE).getValue();
        resource
            .update()
            .withTags(Arrays.asList("foo", "bar2"))
            .withDisplayName("prop3name")
            .withValue("propValue")
            .withSecret(false)
            .withIfMatch("*")
            .apply();
    }
}
