// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.monitoring;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.monitoring.AlertProcessingRuleActionGroupArgs;
import com.pulumi.azure.monitoring.inputs.AlertProcessingRuleActionGroupState;
import com.pulumi.azure.monitoring.outputs.AlertProcessingRuleActionGroupCondition;
import com.pulumi.azure.monitoring.outputs.AlertProcessingRuleActionGroupSchedule;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages an Alert Processing Rule which apply action group.
 * 
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.monitoring.ActionGroup;
 * import com.pulumi.azure.monitoring.ActionGroupArgs;
 * import com.pulumi.azure.monitoring.AlertProcessingRuleActionGroup;
 * import com.pulumi.azure.monitoring.AlertProcessingRuleActionGroupArgs;
 * import com.pulumi.azure.monitoring.inputs.AlertProcessingRuleActionGroupConditionArgs;
 * import com.pulumi.azure.monitoring.inputs.AlertProcessingRuleActionGroupConditionTargetResourceTypeArgs;
 * import com.pulumi.azure.monitoring.inputs.AlertProcessingRuleActionGroupConditionSeverityArgs;
 * import com.pulumi.azure.monitoring.inputs.AlertProcessingRuleActionGroupScheduleArgs;
 * import com.pulumi.azure.monitoring.inputs.AlertProcessingRuleActionGroupScheduleRecurrenceArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         var exampleResourceGroup = new ResourceGroup(&#34;exampleResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var exampleActionGroup = new ActionGroup(&#34;exampleActionGroup&#34;, ActionGroupArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .shortName(&#34;action&#34;)
 *             .build());
 * 
 *         var exampleAlertProcessingRuleActionGroup = new AlertProcessingRuleActionGroup(&#34;exampleAlertProcessingRuleActionGroup&#34;, AlertProcessingRuleActionGroupArgs.builder()        
 *             .resourceGroupName(&#34;example&#34;)
 *             .scopes(exampleResourceGroup.id())
 *             .addActionGroupIds(exampleActionGroup.id())
 *             .condition(AlertProcessingRuleActionGroupConditionArgs.builder()
 *                 .targetResourceType(AlertProcessingRuleActionGroupConditionTargetResourceTypeArgs.builder()
 *                     .operator(&#34;Equals&#34;)
 *                     .values(&#34;Microsoft.Compute/VirtualMachines&#34;)
 *                     .build())
 *                 .severity(AlertProcessingRuleActionGroupConditionSeverityArgs.builder()
 *                     .operator(&#34;Equals&#34;)
 *                     .values(                    
 *                         &#34;Sev0&#34;,
 *                         &#34;Sev1&#34;,
 *                         &#34;Sev2&#34;)
 *                     .build())
 *                 .build())
 *             .schedule(AlertProcessingRuleActionGroupScheduleArgs.builder()
 *                 .effectiveFrom(&#34;2022-01-01T01:02:03&#34;)
 *                 .effectiveUntil(&#34;2022-02-02T01:02:03&#34;)
 *                 .timeZone(&#34;Pacific Standard Time&#34;)
 *                 .recurrence(AlertProcessingRuleActionGroupScheduleRecurrenceArgs.builder()
 *                     .dailies(AlertProcessingRuleActionGroupScheduleRecurrenceDailyArgs.builder()
 *                         .startTime(&#34;17:00:00&#34;)
 *                         .endTime(&#34;09:00:00&#34;)
 *                         .build())
 *                     .weeklies(AlertProcessingRuleActionGroupScheduleRecurrenceWeeklyArgs.builder()
 *                         .daysOfWeeks(                        
 *                             &#34;Saturday&#34;,
 *                             &#34;Sunday&#34;)
 *                         .build())
 *                     .build())
 *                 .build())
 *             .tags(Map.of(&#34;foo&#34;, &#34;bar&#34;))
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Alert Processing Rules can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:monitoring/alertProcessingRuleActionGroup:AlertProcessingRuleActionGroup example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.AlertsManagement/actionRules/actionRule1
 * ```
 * 
 */
@ResourceType(type="azure:monitoring/alertProcessingRuleActionGroup:AlertProcessingRuleActionGroup")
public class AlertProcessingRuleActionGroup extends com.pulumi.resources.CustomResource {
    /**
     * Specifies a list of Action Group IDs.
     * 
     */
    @Export(name="addActionGroupIds", refs={List.class,String.class}, tree="[0,1]")
    private Output<List<String>> addActionGroupIds;

    /**
     * @return Specifies a list of Action Group IDs.
     * 
     */
    public Output<List<String>> addActionGroupIds() {
        return this.addActionGroupIds;
    }
    /**
     * A `condition` block as defined below.
     * 
     */
    @Export(name="condition", refs={AlertProcessingRuleActionGroupCondition.class}, tree="[0]")
    private Output</* @Nullable */ AlertProcessingRuleActionGroupCondition> condition;

    /**
     * @return A `condition` block as defined below.
     * 
     */
    public Output<Optional<AlertProcessingRuleActionGroupCondition>> condition() {
        return Codegen.optional(this.condition);
    }
    /**
     * Specifies a description for the Alert Processing Rule.
     * 
     */
    @Export(name="description", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> description;

    /**
     * @return Specifies a description for the Alert Processing Rule.
     * 
     */
    public Output<Optional<String>> description() {
        return Codegen.optional(this.description);
    }
    /**
     * Should the Alert Processing Rule be enabled? Defaults to `true`.
     * 
     */
    @Export(name="enabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> enabled;

    /**
     * @return Should the Alert Processing Rule be enabled? Defaults to `true`.
     * 
     */
    public Output<Optional<Boolean>> enabled() {
        return Codegen.optional(this.enabled);
    }
    /**
     * The name which should be used for this Alert Processing Rule. Changing this forces a new Alert Processing Rule to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return The name which should be used for this Alert Processing Rule. Changing this forces a new Alert Processing Rule to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The name of the Resource Group where the Alert Processing Rule should exist. Changing this forces a new Alert Processing Rule to be created.
     * 
     */
    @Export(name="resourceGroupName", refs={String.class}, tree="[0]")
    private Output<String> resourceGroupName;

    /**
     * @return The name of the Resource Group where the Alert Processing Rule should exist. Changing this forces a new Alert Processing Rule to be created.
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * A `schedule` block as defined below.
     * 
     */
    @Export(name="schedule", refs={AlertProcessingRuleActionGroupSchedule.class}, tree="[0]")
    private Output</* @Nullable */ AlertProcessingRuleActionGroupSchedule> schedule;

    /**
     * @return A `schedule` block as defined below.
     * 
     */
    public Output<Optional<AlertProcessingRuleActionGroupSchedule>> schedule() {
        return Codegen.optional(this.schedule);
    }
    /**
     * A list of resource IDs which will be the target of alert processing rule.
     * 
     */
    @Export(name="scopes", refs={List.class,String.class}, tree="[0,1]")
    private Output<List<String>> scopes;

    /**
     * @return A list of resource IDs which will be the target of alert processing rule.
     * 
     */
    public Output<List<String>> scopes() {
        return this.scopes;
    }
    /**
     * A mapping of tags which should be assigned to the Alert Processing Rule.
     * 
     */
    @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output</* @Nullable */ Map<String,String>> tags;

    /**
     * @return A mapping of tags which should be assigned to the Alert Processing Rule.
     * 
     */
    public Output<Optional<Map<String,String>>> tags() {
        return Codegen.optional(this.tags);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public AlertProcessingRuleActionGroup(String name) {
        this(name, AlertProcessingRuleActionGroupArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public AlertProcessingRuleActionGroup(String name, AlertProcessingRuleActionGroupArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public AlertProcessingRuleActionGroup(String name, AlertProcessingRuleActionGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:monitoring/alertProcessingRuleActionGroup:AlertProcessingRuleActionGroup", name, args == null ? AlertProcessingRuleActionGroupArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private AlertProcessingRuleActionGroup(String name, Output<String> id, @Nullable AlertProcessingRuleActionGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:monitoring/alertProcessingRuleActionGroup:AlertProcessingRuleActionGroup", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static AlertProcessingRuleActionGroup get(String name, Output<String> id, @Nullable AlertProcessingRuleActionGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new AlertProcessingRuleActionGroup(name, id, state, options);
    }
}
