// *** 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.ActivityLogAlertArgs;
import com.pulumi.azure.monitoring.inputs.ActivityLogAlertState;
import com.pulumi.azure.monitoring.outputs.ActivityLogAlertAction;
import com.pulumi.azure.monitoring.outputs.ActivityLogAlertCriteria;
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 Activity Log Alert within Azure Monitor.
 * 
 * ## 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.inputs.ActionGroupWebhookReceiverArgs;
 * import com.pulumi.azure.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.monitoring.ActivityLogAlert;
 * import com.pulumi.azure.monitoring.ActivityLogAlertArgs;
 * import com.pulumi.azure.monitoring.inputs.ActivityLogAlertCriteriaArgs;
 * import com.pulumi.azure.monitoring.inputs.ActivityLogAlertActionArgs;
 * 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 example = new ResourceGroup(&#34;example&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var mainActionGroup = new ActionGroup(&#34;mainActionGroup&#34;, ActionGroupArgs.builder()        
 *             .resourceGroupName(example.name())
 *             .shortName(&#34;p0action&#34;)
 *             .webhookReceivers(ActionGroupWebhookReceiverArgs.builder()
 *                 .name(&#34;callmyapi&#34;)
 *                 .serviceUri(&#34;http://example.com/alert&#34;)
 *                 .build())
 *             .build());
 * 
 *         var toMonitor = new Account(&#34;toMonitor&#34;, AccountArgs.builder()        
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .accountTier(&#34;Standard&#34;)
 *             .accountReplicationType(&#34;GRS&#34;)
 *             .build());
 * 
 *         var mainActivityLogAlert = new ActivityLogAlert(&#34;mainActivityLogAlert&#34;, ActivityLogAlertArgs.builder()        
 *             .resourceGroupName(example.name())
 *             .scopes(example.id())
 *             .description(&#34;This alert will monitor a specific storage account updates.&#34;)
 *             .criteria(ActivityLogAlertCriteriaArgs.builder()
 *                 .resourceId(toMonitor.id())
 *                 .operationName(&#34;Microsoft.Storage/storageAccounts/write&#34;)
 *                 .category(&#34;Recommendation&#34;)
 *                 .build())
 *             .actions(ActivityLogAlertActionArgs.builder()
 *                 .actionGroupId(mainActionGroup.id())
 *                 .webhookProperties(Map.of(&#34;from&#34;, &#34;source&#34;))
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Activity log alerts can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:monitoring/activityLogAlert:ActivityLogAlert example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Insights/activityLogAlerts/myalertname
 * ```
 * 
 */
@ResourceType(type="azure:monitoring/activityLogAlert:ActivityLogAlert")
public class ActivityLogAlert extends com.pulumi.resources.CustomResource {
    /**
     * One or more `action` blocks as defined below.
     * 
     */
    @Export(name="actions", refs={List.class,ActivityLogAlertAction.class}, tree="[0,1]")
    private Output</* @Nullable */ List<ActivityLogAlertAction>> actions;

    /**
     * @return One or more `action` blocks as defined below.
     * 
     */
    public Output<Optional<List<ActivityLogAlertAction>>> actions() {
        return Codegen.optional(this.actions);
    }
    /**
     * A `criteria` block as defined below.
     * 
     */
    @Export(name="criteria", refs={ActivityLogAlertCriteria.class}, tree="[0]")
    private Output<ActivityLogAlertCriteria> criteria;

    /**
     * @return A `criteria` block as defined below.
     * 
     */
    public Output<ActivityLogAlertCriteria> criteria() {
        return this.criteria;
    }
    /**
     * The description of this activity log alert.
     * 
     */
    @Export(name="description", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> description;

    /**
     * @return The description of this activity log alert.
     * 
     */
    public Output<Optional<String>> description() {
        return Codegen.optional(this.description);
    }
    /**
     * Should this Activity Log Alert be enabled? Defaults to `true`.
     * 
     */
    @Export(name="enabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> enabled;

    /**
     * @return Should this Activity Log Alert be enabled? Defaults to `true`.
     * 
     */
    public Output<Optional<Boolean>> enabled() {
        return Codegen.optional(this.enabled);
    }
    /**
     * The name of the activity log alert. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return The name of the activity log alert. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The name of the resource group in which to create the activity log alert instance. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="resourceGroupName", refs={String.class}, tree="[0]")
    private Output<String> resourceGroupName;

    /**
     * @return The name of the resource group in which to create the activity log alert instance. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * The Scope at which the Activity Log should be applied. A list of strings which could be a resource group , or a subscription, or a resource ID (such as a Storage Account).
     * 
     */
    @Export(name="scopes", refs={List.class,String.class}, tree="[0,1]")
    private Output<List<String>> scopes;

    /**
     * @return The Scope at which the Activity Log should be applied. A list of strings which could be a resource group , or a subscription, or a resource ID (such as a Storage Account).
     * 
     */
    public Output<List<String>> scopes() {
        return this.scopes;
    }
    /**
     * A mapping of tags to assign to the resource.
     * 
     */
    @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output</* @Nullable */ Map<String,String>> tags;

    /**
     * @return A mapping of tags to assign to the resource.
     * 
     */
    public Output<Optional<Map<String,String>>> tags() {
        return Codegen.optional(this.tags);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public ActivityLogAlert(String name) {
        this(name, ActivityLogAlertArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public ActivityLogAlert(String name, ActivityLogAlertArgs 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 ActivityLogAlert(String name, ActivityLogAlertArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:monitoring/activityLogAlert:ActivityLogAlert", name, args == null ? ActivityLogAlertArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private ActivityLogAlert(String name, Output<String> id, @Nullable ActivityLogAlertState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:monitoring/activityLogAlert:ActivityLogAlert", 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 ActivityLogAlert get(String name, Output<String> id, @Nullable ActivityLogAlertState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new ActivityLogAlert(name, id, state, options);
    }
}
