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

package com.azure.resourcemanager.timeseriesinsights.generated;

import com.azure.resourcemanager.timeseriesinsights.models.AccessPolicyResource;
import com.azure.resourcemanager.timeseriesinsights.models.AccessPolicyRole;
import java.util.Arrays;

/** Samples for AccessPolicies Update. */
public final class AccessPoliciesUpdateSamples {
    /*
     * x-ms-original-file: specification/timeseriesinsights/resource-manager/Microsoft.TimeSeriesInsights/stable/2020-05-15/examples/AccessPoliciesPatchRoles.json
     */
    /**
     * Sample code: AccessPoliciesUpdate.
     *
     * @param manager Entry point to TimeSeriesInsightsManager.
     */
    public static void accessPoliciesUpdate(
        com.azure.resourcemanager.timeseriesinsights.TimeSeriesInsightsManager manager) {
        AccessPolicyResource resource =
            manager.accessPolicies().getWithResponse("rg1", "env1", "ap1", com.azure.core.util.Context.NONE).getValue();
        resource.update().withRoles(Arrays.asList(AccessPolicyRole.READER, AccessPolicyRole.CONTRIBUTOR)).apply();
    }
}
