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

package com.azure.resourcemanager.security.models;

import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner;

/** Resource collection API of AlertsSuppressionRules. */
public interface AlertsSuppressionRules {
    /**
     * List of all the dismiss rules for the given 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 suppression rules list for subscription as paginated response with {@link PagedIterable}.
     */
    PagedIterable<AlertsSuppressionRule> list();

    /**
     * List of all the dismiss rules for the given subscription.
     *
     * @param alertType Type of the alert to get rules for.
     * @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 suppression rules list for subscription as paginated response with {@link PagedIterable}.
     */
    PagedIterable<AlertsSuppressionRule> list(String alertType, Context context);

    /**
     * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription.
     *
     * @param alertsSuppressionRuleName The unique name of the suppression alert rule.
     * @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 dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with {@link
     *     Response}.
     */
    Response<AlertsSuppressionRule> getWithResponse(String alertsSuppressionRuleName, Context context);

    /**
     * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription.
     *
     * @param alertsSuppressionRuleName The unique name of the suppression alert rule.
     * @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 dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription.
     */
    AlertsSuppressionRule get(String alertsSuppressionRuleName);

    /**
     * Update existing rule or create new rule if it doesn't exist.
     *
     * @param alertsSuppressionRuleName The unique name of the suppression alert rule.
     * @param alertsSuppressionRule Suppression rule object.
     * @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 describes the suppression rule along with {@link Response}.
     */
    Response<AlertsSuppressionRule> updateWithResponse(
        String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule, Context context);

    /**
     * Update existing rule or create new rule if it doesn't exist.
     *
     * @param alertsSuppressionRuleName The unique name of the suppression alert rule.
     * @param alertsSuppressionRule Suppression rule object.
     * @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 describes the suppression rule.
     */
    AlertsSuppressionRule update(String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule);

    /**
     * Delete dismiss alert rule for this subscription.
     *
     * @param alertsSuppressionRuleName The unique name of the suppression alert rule.
     * @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 {@link Response}.
     */
    Response<Void> deleteWithResponse(String alertsSuppressionRuleName, Context context);

    /**
     * Delete dismiss alert rule for this subscription.
     *
     * @param alertsSuppressionRuleName The unique name of the suppression alert rule.
     * @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 delete(String alertsSuppressionRuleName);
}
