// 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.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
import com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentInner;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in PolicyAssignmentsClient. */
public interface PolicyAssignmentsClient
    extends InnerSupportsListing<PolicyAssignmentInner>, InnerSupportsDelete<PolicyAssignmentInner> {
    /**
     * Deletes a policy assignment.
     *
     * @param scope The scope of the policy assignment.
     * @param policyAssignmentName The name of the policy assignment to delete.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<PolicyAssignmentInner>> deleteWithResponseAsync(String scope, String policyAssignmentName);

    /**
     * Deletes a policy assignment.
     *
     * @param scope The scope of the policy assignment.
     * @param policyAssignmentName The name of the policy assignment to delete.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<PolicyAssignmentInner> deleteAsync(String scope, String policyAssignmentName);

    /**
     * Deletes a policy assignment.
     *
     * @param scope The scope of the policy assignment.
     * @param policyAssignmentName The name of the policy assignment to delete.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PolicyAssignmentInner delete(String scope, String policyAssignmentName);

    /**
     * Deletes a policy assignment.
     *
     * @param scope The scope of the policy assignment.
     * @param policyAssignmentName The name of the policy assignment to delete.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<PolicyAssignmentInner> deleteWithResponse(String scope, String policyAssignmentName, Context context);

    /**
     * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group
     * that policy is assigned to all resources in the group.
     *
     * @param scope The scope of the policy assignment.
     * @param policyAssignmentName The name of the policy assignment.
     * @param parameters Parameters for the policy assignment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<PolicyAssignmentInner>> createWithResponseAsync(
        String scope, String policyAssignmentName, PolicyAssignmentInner parameters);

    /**
     * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group
     * that policy is assigned to all resources in the group.
     *
     * @param scope The scope of the policy assignment.
     * @param policyAssignmentName The name of the policy assignment.
     * @param parameters Parameters for the policy assignment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<PolicyAssignmentInner> createAsync(
        String scope, String policyAssignmentName, PolicyAssignmentInner parameters);

    /**
     * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group
     * that policy is assigned to all resources in the group.
     *
     * @param scope The scope of the policy assignment.
     * @param policyAssignmentName The name of the policy assignment.
     * @param parameters Parameters for the policy assignment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PolicyAssignmentInner create(String scope, String policyAssignmentName, PolicyAssignmentInner parameters);

    /**
     * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group
     * that policy is assigned to all resources in the group.
     *
     * @param scope The scope of the policy assignment.
     * @param policyAssignmentName The name of the policy assignment.
     * @param parameters Parameters for the policy assignment.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<PolicyAssignmentInner> createWithResponse(
        String scope, String policyAssignmentName, PolicyAssignmentInner parameters, Context context);

    /**
     * Gets a policy assignment.
     *
     * @param scope The scope of the policy assignment.
     * @param policyAssignmentName The name of the policy assignment to get.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<PolicyAssignmentInner>> getWithResponseAsync(String scope, String policyAssignmentName);

    /**
     * Gets a policy assignment.
     *
     * @param scope The scope of the policy assignment.
     * @param policyAssignmentName The name of the policy assignment to get.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<PolicyAssignmentInner> getAsync(String scope, String policyAssignmentName);

    /**
     * Gets a policy assignment.
     *
     * @param scope The scope of the policy assignment.
     * @param policyAssignmentName The name of the policy assignment to get.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PolicyAssignmentInner get(String scope, String policyAssignmentName);

    /**
     * Gets a policy assignment.
     *
     * @param scope The scope of the policy assignment.
     * @param policyAssignmentName The name of the policy assignment to get.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<PolicyAssignmentInner> getWithResponse(String scope, String policyAssignmentName, Context context);

    /**
     * Gets policy assignments for the resource group.
     *
     * @param resourceGroupName The name of the resource group that contains policy assignments.
     * @param filter The filter to apply on the operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return policy assignments for the resource group.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedFlux<PolicyAssignmentInner> listByResourceGroupAsync(String resourceGroupName, String filter);

    /**
     * Gets policy assignments for the resource group.
     *
     * @param resourceGroupName The name of the resource group that contains policy assignments.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return policy assignments for the resource group.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedFlux<PolicyAssignmentInner> listByResourceGroupAsync(String resourceGroupName);

    /**
     * Gets policy assignments for the resource group.
     *
     * @param resourceGroupName The name of the resource group that contains policy assignments.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return policy assignments for the resource group.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<PolicyAssignmentInner> listByResourceGroup(String resourceGroupName);

    /**
     * Gets policy assignments for the resource group.
     *
     * @param resourceGroupName The name of the resource group that contains policy assignments.
     * @param filter The filter to apply on the operation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return policy assignments for the resource group.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<PolicyAssignmentInner> listByResourceGroup(String resourceGroupName, String filter, Context context);

    /**
     * Gets policy assignments for a resource.
     *
     * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
     * @param resourceProviderNamespace The namespace of the resource provider.
     * @param parentResourcePath The parent resource path.
     * @param resourceType The resource type.
     * @param resourceName The name of the resource with policy assignments.
     * @param filter The filter to apply on the operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return policy assignments for a resource.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedFlux<PolicyAssignmentInner> listForResourceAsync(
        String resourceGroupName,
        String resourceProviderNamespace,
        String parentResourcePath,
        String resourceType,
        String resourceName,
        String filter);

    /**
     * Gets policy assignments for a resource.
     *
     * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
     * @param resourceProviderNamespace The namespace of the resource provider.
     * @param parentResourcePath The parent resource path.
     * @param resourceType The resource type.
     * @param resourceName The name of the resource with policy assignments.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return policy assignments for a resource.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedFlux<PolicyAssignmentInner> listForResourceAsync(
        String resourceGroupName,
        String resourceProviderNamespace,
        String parentResourcePath,
        String resourceType,
        String resourceName);

    /**
     * Gets policy assignments for a resource.
     *
     * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
     * @param resourceProviderNamespace The namespace of the resource provider.
     * @param parentResourcePath The parent resource path.
     * @param resourceType The resource type.
     * @param resourceName The name of the resource with policy assignments.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return policy assignments for a resource.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<PolicyAssignmentInner> listForResource(
        String resourceGroupName,
        String resourceProviderNamespace,
        String parentResourcePath,
        String resourceType,
        String resourceName);

    /**
     * Gets policy assignments for a resource.
     *
     * @param resourceGroupName The name of the resource group containing the resource. The name is case insensitive.
     * @param resourceProviderNamespace The namespace of the resource provider.
     * @param parentResourcePath The parent resource path.
     * @param resourceType The resource type.
     * @param resourceName The name of the resource with policy assignments.
     * @param filter The filter to apply on the operation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return policy assignments for a resource.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<PolicyAssignmentInner> listForResource(
        String resourceGroupName,
        String resourceProviderNamespace,
        String parentResourcePath,
        String resourceType,
        String resourceName,
        String filter,
        Context context);

    /**
     * Gets all the policy assignments for a subscription.
     *
     * @param filter The filter to apply on the operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return all the policy assignments for a subscription.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedFlux<PolicyAssignmentInner> listAsync(String filter);

    /**
     * Gets all the policy assignments for a subscription.
     *
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return all the policy assignments for a subscription.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedFlux<PolicyAssignmentInner> listAsync();

    /**
     * Gets all the policy assignments for a subscription.
     *
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return all the policy assignments for a subscription.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<PolicyAssignmentInner> list();

    /**
     * Gets all the policy assignments for a subscription.
     *
     * @param filter The filter to apply on the operation.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return all the policy assignments for a subscription.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<PolicyAssignmentInner> list(String filter, Context context);

    /**
     * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions,
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
     * for resources.
     *
     * @param policyAssignmentId The ID of the policy assignment to delete. Use the format
     *     '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<PolicyAssignmentInner>> deleteByIdWithResponseAsync(String policyAssignmentId);

    /**
     * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions,
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
     * for resources.
     *
     * @param policyAssignmentId The ID of the policy assignment to delete. Use the format
     *     '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<PolicyAssignmentInner> deleteByIdAsync(String policyAssignmentId);

    /**
     * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions,
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
     * for resources.
     *
     * @param policyAssignmentId The ID of the policy assignment to delete. Use the format
     *     '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PolicyAssignmentInner deleteById(String policyAssignmentId);

    /**
     * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions,
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
     * for resources.
     *
     * @param policyAssignmentId The ID of the policy assignment to delete. Use the format
     *     '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<PolicyAssignmentInner> deleteByIdWithResponse(String policyAssignmentId, Context context);

    /**
     * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group
     * that policy is assigned to all resources in the group. When providing a scope for the assignment, use
     * '/subscriptions/{subscription-id}/' for subscriptions,
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
     * for resources.
     *
     * @param policyAssignmentId The ID of the policy assignment to create. Use the format
     *     '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
     * @param parameters Parameters for policy assignment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<PolicyAssignmentInner>> createByIdWithResponseAsync(
        String policyAssignmentId, PolicyAssignmentInner parameters);

    /**
     * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group
     * that policy is assigned to all resources in the group. When providing a scope for the assignment, use
     * '/subscriptions/{subscription-id}/' for subscriptions,
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
     * for resources.
     *
     * @param policyAssignmentId The ID of the policy assignment to create. Use the format
     *     '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
     * @param parameters Parameters for policy assignment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<PolicyAssignmentInner> createByIdAsync(String policyAssignmentId, PolicyAssignmentInner parameters);

    /**
     * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group
     * that policy is assigned to all resources in the group. When providing a scope for the assignment, use
     * '/subscriptions/{subscription-id}/' for subscriptions,
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
     * for resources.
     *
     * @param policyAssignmentId The ID of the policy assignment to create. Use the format
     *     '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
     * @param parameters Parameters for policy assignment.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PolicyAssignmentInner createById(String policyAssignmentId, PolicyAssignmentInner parameters);

    /**
     * Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group
     * that policy is assigned to all resources in the group. When providing a scope for the assignment, use
     * '/subscriptions/{subscription-id}/' for subscriptions,
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
     * for resources.
     *
     * @param policyAssignmentId The ID of the policy assignment to create. Use the format
     *     '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
     * @param parameters Parameters for policy assignment.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<PolicyAssignmentInner> createByIdWithResponse(
        String policyAssignmentId, PolicyAssignmentInner parameters, Context context);

    /**
     * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions,
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
     * for resources.
     *
     * @param policyAssignmentId The ID of the policy assignment to get. Use the format
     *     '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<PolicyAssignmentInner>> getByIdWithResponseAsync(String policyAssignmentId);

    /**
     * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions,
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
     * for resources.
     *
     * @param policyAssignmentId The ID of the policy assignment to get. Use the format
     *     '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<PolicyAssignmentInner> getByIdAsync(String policyAssignmentId);

    /**
     * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions,
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
     * for resources.
     *
     * @param policyAssignmentId The ID of the policy assignment to get. Use the format
     *     '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PolicyAssignmentInner getById(String policyAssignmentId);

    /**
     * When providing a scope for the assignment, use '/subscriptions/{subscription-id}/' for subscriptions,
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and
     * '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}'
     * for resources.
     *
     * @param policyAssignmentId The ID of the policy assignment to get. Use the format
     *     '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the policy assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<PolicyAssignmentInner> getByIdWithResponse(String policyAssignmentId, Context context);
}
