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

package com.azure.resourcemanager.alertsmanagement.models;

import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;

/** Resource collection API of AlertProcessingRules. */
public interface AlertProcessingRules {
    /**
     * List all alert processing rules in 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 list of alert processing rules as paginated response with {@link PagedIterable}.
     */
    PagedIterable<AlertProcessingRule> list();

    /**
     * List all alert processing rules in a subscription.
     *
     * @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 list of alert processing rules as paginated response with {@link PagedIterable}.
     */
    PagedIterable<AlertProcessingRule> list(Context context);

    /**
     * List all alert processing rules in a resource group.
     *
     * @param resourceGroupName Resource group name where the resource is created.
     * @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 list of alert processing rules as paginated response with {@link PagedIterable}.
     */
    PagedIterable<AlertProcessingRule> listByResourceGroup(String resourceGroupName);

    /**
     * List all alert processing rules in a resource group.
     *
     * @param resourceGroupName Resource group name where the resource is created.
     * @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 list of alert processing rules as paginated response with {@link PagedIterable}.
     */
    PagedIterable<AlertProcessingRule> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * Get an alert processing rule by name.
     *
     * @param resourceGroupName Resource group name where the resource is created.
     * @param alertProcessingRuleName The name of the alert processing rule that needs to be fetched.
     * @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 an alert processing rule by name.
     */
    AlertProcessingRule getByResourceGroup(String resourceGroupName, String alertProcessingRuleName);

    /**
     * Get an alert processing rule by name.
     *
     * @param resourceGroupName Resource group name where the resource is created.
     * @param alertProcessingRuleName The name of the alert processing rule that needs to be fetched.
     * @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 an alert processing rule by name.
     */
    Response<AlertProcessingRule> getByResourceGroupWithResponse(
        String resourceGroupName, String alertProcessingRuleName, Context context);

    /**
     * Delete an alert processing rule.
     *
     * @param resourceGroupName Resource group name where the resource is created.
     * @param alertProcessingRuleName The name of the alert processing rule that needs to be deleted.
     * @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.
     */
    void deleteByResourceGroup(String resourceGroupName, String alertProcessingRuleName);

    /**
     * Delete an alert processing rule.
     *
     * @param resourceGroupName Resource group name where the resource is created.
     * @param alertProcessingRuleName The name of the alert processing rule that needs to be deleted.
     * @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 response.
     */
    AlertProcessingRulesDeleteResponse deleteWithResponse(
        String resourceGroupName, String alertProcessingRuleName, Context context);

    /**
     * Get an alert processing rule by name.
     *
     * @param id the resource ID.
     * @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 an alert processing rule by name.
     */
    AlertProcessingRule getById(String id);

    /**
     * Get an alert processing rule by name.
     *
     * @param id the resource ID.
     * @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 an alert processing rule by name.
     */
    Response<AlertProcessingRule> getByIdWithResponse(String id, Context context);

    /**
     * Delete an alert processing rule.
     *
     * @param id the resource ID.
     * @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.
     */
    void deleteById(String id);

    /**
     * Delete an alert processing rule.
     *
     * @param id the resource ID.
     * @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 response.
     */
    AlertProcessingRulesDeleteResponse deleteByIdWithResponse(String id, Context context);

    /**
     * Begins definition for a new AlertProcessingRule resource.
     *
     * @param name resource name.
     * @return the first stage of the new AlertProcessingRule definition.
     */
    AlertProcessingRule.DefinitionStages.Blank define(String name);
}
