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

package com.azure.resourcemanager.resources.generated;

/** Samples for PolicyAssignments ListForResource. */
public final class PolicyAssignmentsListForResourceSamples {
    /*
     * x-ms-original-file: specification/resources/resource-manager/Microsoft.Authorization/stable/2022-06-01/examples/listPolicyAssignmentsForResource.json
     */
    /**
     * Sample code: List all policy assignments that apply to a resource.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void listAllPolicyAssignmentsThatApplyToAResource(
        com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .genericResources()
            .manager()
            .policyClient()
            .getPolicyAssignments()
            .listForResource(
                "TestResourceGroup",
                "Microsoft.Compute",
                "virtualMachines/MyTestVm",
                "domainNames",
                "MyTestComputer.cloudapp.net",
                null,
                null,
                com.azure.core.util.Context.NONE);
    }
}
