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

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.util.Context;
import com.azure.resourcemanager.alertsmanagement.fluent.models.AlertProcessingRuleInner;
import com.azure.resourcemanager.alertsmanagement.models.AlertProcessingRulesCreateOrUpdateResponse;
import com.azure.resourcemanager.alertsmanagement.models.AlertProcessingRulesDeleteResponse;
import com.azure.resourcemanager.alertsmanagement.models.AlertProcessingRulesGetByResourceGroupResponse;
import com.azure.resourcemanager.alertsmanagement.models.AlertProcessingRulesUpdateResponse;
import com.azure.resourcemanager.alertsmanagement.models.PatchObject;

/** An instance of this class provides access to all the operations defined in AlertProcessingRulesClient. */
public interface AlertProcessingRulesClient {
    /**
     * 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}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<AlertProcessingRuleInner> 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}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<AlertProcessingRuleInner> 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}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<AlertProcessingRuleInner> 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}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<AlertProcessingRuleInner> 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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    AlertProcessingRuleInner 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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    AlertProcessingRulesGetByResourceGroupResponse getByResourceGroupWithResponse(
        String resourceGroupName, String alertProcessingRuleName, Context context);

    /**
     * Create or update 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 created/updated.
     * @param alertProcessingRule Alert processing rule to be created/updated.
     * @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 alert processing rule object containing target scopes, conditions and scheduling logic.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    AlertProcessingRuleInner createOrUpdate(
        String resourceGroupName, String alertProcessingRuleName, AlertProcessingRuleInner alertProcessingRule);

    /**
     * Create or update 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 created/updated.
     * @param alertProcessingRule Alert processing rule to be created/updated.
     * @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 alert processing rule object containing target scopes, conditions and scheduling logic.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    AlertProcessingRulesCreateOrUpdateResponse createOrUpdateWithResponse(
        String resourceGroupName,
        String alertProcessingRuleName,
        AlertProcessingRuleInner alertProcessingRule,
        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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    AlertProcessingRulesDeleteResponse deleteWithResponse(
        String resourceGroupName, String alertProcessingRuleName, Context context);

    /**
     * Enable, disable, or update tags for an alert processing rule.
     *
     * @param resourceGroupName Resource group name where the resource is created.
     * @param alertProcessingRuleName The name that needs to be updated.
     * @param alertProcessingRulePatch Parameters supplied to 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 alert processing rule object containing target scopes, conditions and scheduling logic.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    AlertProcessingRuleInner update(
        String resourceGroupName, String alertProcessingRuleName, PatchObject alertProcessingRulePatch);

    /**
     * Enable, disable, or update tags for an alert processing rule.
     *
     * @param resourceGroupName Resource group name where the resource is created.
     * @param alertProcessingRuleName The name that needs to be updated.
     * @param alertProcessingRulePatch Parameters supplied to 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 alert processing rule object containing target scopes, conditions and scheduling logic.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    AlertProcessingRulesUpdateResponse updateWithResponse(
        String resourceGroupName,
        String alertProcessingRuleName,
        PatchObject alertProcessingRulePatch,
        Context context);
}
