All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.monitoring.kotlin.ScheduledQueryRulesAlertV2Args.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.monitoring.kotlin

import com.pulumi.azure.monitoring.ScheduledQueryRulesAlertV2Args.builder
import com.pulumi.azure.monitoring.kotlin.inputs.ScheduledQueryRulesAlertV2ActionArgs
import com.pulumi.azure.monitoring.kotlin.inputs.ScheduledQueryRulesAlertV2ActionArgsBuilder
import com.pulumi.azure.monitoring.kotlin.inputs.ScheduledQueryRulesAlertV2CriteriaArgs
import com.pulumi.azure.monitoring.kotlin.inputs.ScheduledQueryRulesAlertV2CriteriaArgsBuilder
import com.pulumi.azure.monitoring.kotlin.inputs.ScheduledQueryRulesAlertV2IdentityArgs
import com.pulumi.azure.monitoring.kotlin.inputs.ScheduledQueryRulesAlertV2IdentityArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages an AlertingAction Scheduled Query Rules Version 2 resource within Azure Monitor
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleInsights = new azure.appinsights.Insights("example", {
 *     name: "example-ai",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     applicationType: "web",
 * });
 * const exampleActionGroup = new azure.monitoring.ActionGroup("example", {
 *     name: "example-mag",
 *     resourceGroupName: example.name,
 *     shortName: "test mag",
 * });
 * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("example", {
 *     name: "example-uai",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleAssignment = new azure.authorization.Assignment("example", {
 *     scope: exampleInsights.id,
 *     roleDefinitionName: "Reader",
 *     principalId: exampleUserAssignedIdentity.principalId,
 * });
 * const exampleScheduledQueryRulesAlertV2 = new azure.monitoring.ScheduledQueryRulesAlertV2("example", {
 *     name: "example-msqrv2",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     evaluationFrequency: "PT10M",
 *     windowDuration: "PT10M",
 *     scopes: exampleInsights.id,
 *     severity: 4,
 *     criterias: [{
 *         query: `requests
 *   | summarize CountByCountry=count() by client_CountryOrRegion
 * `,
 *         timeAggregationMethod: "Maximum",
 *         threshold: 17.5,
 *         operator: "LessThan",
 *         resourceIdColumn: "client_CountryOrRegion",
 *         metricMeasureColumn: "CountByCountry",
 *         dimensions: [{
 *             name: "client_CountryOrRegion",
 *             operator: "Exclude",
 *             values: ["123"],
 *         }],
 *         failingPeriods: {
 *             minimumFailingPeriodsToTriggerAlert: 1,
 *             numberOfEvaluationPeriods: 1,
 *         },
 *     }],
 *     autoMitigationEnabled: true,
 *     workspaceAlertsStorageEnabled: false,
 *     description: "example sqr",
 *     displayName: "example-sqr",
 *     enabled: true,
 *     queryTimeRangeOverride: "PT1H",
 *     skipQueryValidation: true,
 *     action: {
 *         actionGroups: [exampleActionGroup.id],
 *         customProperties: {
 *             key: "value",
 *             key2: "value2",
 *         },
 *     },
 *     identity: {
 *         type: "UserAssigned",
 *         identityIds: [exampleUserAssignedIdentity.id],
 *     },
 *     tags: {
 *         key: "value",
 *         key2: "value2",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_insights = azure.appinsights.Insights("example",
 *     name="example-ai",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     application_type="web")
 * example_action_group = azure.monitoring.ActionGroup("example",
 *     name="example-mag",
 *     resource_group_name=example.name,
 *     short_name="test mag")
 * example_user_assigned_identity = azure.authorization.UserAssignedIdentity("example",
 *     name="example-uai",
 *     location=example.location,
 *     resource_group_name=example.name)
 * example_assignment = azure.authorization.Assignment("example",
 *     scope=example_insights.id,
 *     role_definition_name="Reader",
 *     principal_id=example_user_assigned_identity.principal_id)
 * example_scheduled_query_rules_alert_v2 = azure.monitoring.ScheduledQueryRulesAlertV2("example",
 *     name="example-msqrv2",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     evaluation_frequency="PT10M",
 *     window_duration="PT10M",
 *     scopes=example_insights.id,
 *     severity=4,
 *     criterias=[azure.monitoring.ScheduledQueryRulesAlertV2CriteriaArgs(
 *         query="""requests
 *   | summarize CountByCountry=count() by client_CountryOrRegion
 * """,
 *         time_aggregation_method="Maximum",
 *         threshold=17.5,
 *         operator="LessThan",
 *         resource_id_column="client_CountryOrRegion",
 *         metric_measure_column="CountByCountry",
 *         dimensions=[azure.monitoring.ScheduledQueryRulesAlertV2CriteriaDimensionArgs(
 *             name="client_CountryOrRegion",
 *             operator="Exclude",
 *             values=["123"],
 *         )],
 *         failing_periods=azure.monitoring.ScheduledQueryRulesAlertV2CriteriaFailingPeriodsArgs(
 *             minimum_failing_periods_to_trigger_alert=1,
 *             number_of_evaluation_periods=1,
 *         ),
 *     )],
 *     auto_mitigation_enabled=True,
 *     workspace_alerts_storage_enabled=False,
 *     description="example sqr",
 *     display_name="example-sqr",
 *     enabled=True,
 *     query_time_range_override="PT1H",
 *     skip_query_validation=True,
 *     action=azure.monitoring.ScheduledQueryRulesAlertV2ActionArgs(
 *         action_groups=[example_action_group.id],
 *         custom_properties={
 *             "key": "value",
 *             "key2": "value2",
 *         },
 *     ),
 *     identity=azure.monitoring.ScheduledQueryRulesAlertV2IdentityArgs(
 *         type="UserAssigned",
 *         identity_ids=[example_user_assigned_identity.id],
 *     ),
 *     tags={
 *         "key": "value",
 *         "key2": "value2",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleInsights = new Azure.AppInsights.Insights("example", new()
 *     {
 *         Name = "example-ai",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         ApplicationType = "web",
 *     });
 *     var exampleActionGroup = new Azure.Monitoring.ActionGroup("example", new()
 *     {
 *         Name = "example-mag",
 *         ResourceGroupName = example.Name,
 *         ShortName = "test mag",
 *     });
 *     var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("example", new()
 *     {
 *         Name = "example-uai",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *     });
 *     var exampleAssignment = new Azure.Authorization.Assignment("example", new()
 *     {
 *         Scope = exampleInsights.Id,
 *         RoleDefinitionName = "Reader",
 *         PrincipalId = exampleUserAssignedIdentity.PrincipalId,
 *     });
 *     var exampleScheduledQueryRulesAlertV2 = new Azure.Monitoring.ScheduledQueryRulesAlertV2("example", new()
 *     {
 *         Name = "example-msqrv2",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         EvaluationFrequency = "PT10M",
 *         WindowDuration = "PT10M",
 *         Scopes = exampleInsights.Id,
 *         Severity = 4,
 *         Criterias = new[]
 *         {
 *             new Azure.Monitoring.Inputs.ScheduledQueryRulesAlertV2CriteriaArgs
 *             {
 *                 Query = @"requests
 *   | summarize CountByCountry=count() by client_CountryOrRegion
 * ",
 *                 TimeAggregationMethod = "Maximum",
 *                 Threshold = 17.5,
 *                 Operator = "LessThan",
 *                 ResourceIdColumn = "client_CountryOrRegion",
 *                 MetricMeasureColumn = "CountByCountry",
 *                 Dimensions = new[]
 *                 {
 *                     new Azure.Monitoring.Inputs.ScheduledQueryRulesAlertV2CriteriaDimensionArgs
 *                     {
 *                         Name = "client_CountryOrRegion",
 *                         Operator = "Exclude",
 *                         Values = new[]
 *                         {
 *                             "123",
 *                         },
 *                     },
 *                 },
 *                 FailingPeriods = new Azure.Monitoring.Inputs.ScheduledQueryRulesAlertV2CriteriaFailingPeriodsArgs
 *                 {
 *                     MinimumFailingPeriodsToTriggerAlert = 1,
 *                     NumberOfEvaluationPeriods = 1,
 *                 },
 *             },
 *         },
 *         AutoMitigationEnabled = true,
 *         WorkspaceAlertsStorageEnabled = false,
 *         Description = "example sqr",
 *         DisplayName = "example-sqr",
 *         Enabled = true,
 *         QueryTimeRangeOverride = "PT1H",
 *         SkipQueryValidation = true,
 *         Action = new Azure.Monitoring.Inputs.ScheduledQueryRulesAlertV2ActionArgs
 *         {
 *             ActionGroups = new[]
 *             {
 *                 exampleActionGroup.Id,
 *             },
 *             CustomProperties =
 *             {
 *                 { "key", "value" },
 *                 { "key2", "value2" },
 *             },
 *         },
 *         Identity = new Azure.Monitoring.Inputs.ScheduledQueryRulesAlertV2IdentityArgs
 *         {
 *             Type = "UserAssigned",
 *             IdentityIds = new[]
 *             {
 *                 exampleUserAssignedIdentity.Id,
 *             },
 *         },
 *         Tags =
 *         {
 *             { "key", "value" },
 *             { "key2", "value2" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleInsights, err := appinsights.NewInsights(ctx, "example", &appinsights.InsightsArgs{
 * 			Name:              pulumi.String("example-ai"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			ApplicationType:   pulumi.String("web"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleActionGroup, err := monitoring.NewActionGroup(ctx, "example", &monitoring.ActionGroupArgs{
 * 			Name:              pulumi.String("example-mag"),
 * 			ResourceGroupName: example.Name,
 * 			ShortName:         pulumi.String("test mag"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "example", &authorization.UserAssignedIdentityArgs{
 * 			Name:              pulumi.String("example-uai"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = authorization.NewAssignment(ctx, "example", &authorization.AssignmentArgs{
 * 			Scope:              exampleInsights.ID(),
 * 			RoleDefinitionName: pulumi.String("Reader"),
 * 			PrincipalId:        exampleUserAssignedIdentity.PrincipalId,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = monitoring.NewScheduledQueryRulesAlertV2(ctx, "example", &monitoring.ScheduledQueryRulesAlertV2Args{
 * 			Name:                pulumi.String("example-msqrv2"),
 * 			ResourceGroupName:   example.Name,
 * 			Location:            example.Location,
 * 			EvaluationFrequency: pulumi.String("PT10M"),
 * 			WindowDuration:      pulumi.String("PT10M"),
 * 			Scopes:              exampleInsights.ID(),
 * 			Severity:            pulumi.Int(4),
 * 			Criterias: monitoring.ScheduledQueryRulesAlertV2CriteriaArray{
 * 				&monitoring.ScheduledQueryRulesAlertV2CriteriaArgs{
 * 					Query:                 pulumi.String("requests\n  | summarize CountByCountry=count() by client_CountryOrRegion\n"),
 * 					TimeAggregationMethod: pulumi.String("Maximum"),
 * 					Threshold:             pulumi.Float64(17.5),
 * 					Operator:              pulumi.String("LessThan"),
 * 					ResourceIdColumn:      pulumi.String("client_CountryOrRegion"),
 * 					MetricMeasureColumn:   pulumi.String("CountByCountry"),
 * 					Dimensions: monitoring.ScheduledQueryRulesAlertV2CriteriaDimensionArray{
 * 						&monitoring.ScheduledQueryRulesAlertV2CriteriaDimensionArgs{
 * 							Name:     pulumi.String("client_CountryOrRegion"),
 * 							Operator: pulumi.String("Exclude"),
 * 							Values: pulumi.StringArray{
 * 								pulumi.String("123"),
 * 							},
 * 						},
 * 					},
 * 					FailingPeriods: &monitoring.ScheduledQueryRulesAlertV2CriteriaFailingPeriodsArgs{
 * 						MinimumFailingPeriodsToTriggerAlert: pulumi.Int(1),
 * 						NumberOfEvaluationPeriods:           pulumi.Int(1),
 * 					},
 * 				},
 * 			},
 * 			AutoMitigationEnabled:         pulumi.Bool(true),
 * 			WorkspaceAlertsStorageEnabled: pulumi.Bool(false),
 * 			Description:                   pulumi.String("example sqr"),
 * 			DisplayName:                   pulumi.String("example-sqr"),
 * 			Enabled:                       pulumi.Bool(true),
 * 			QueryTimeRangeOverride:        pulumi.String("PT1H"),
 * 			SkipQueryValidation:           pulumi.Bool(true),
 * 			Action: &monitoring.ScheduledQueryRulesAlertV2ActionArgs{
 * 				ActionGroups: pulumi.StringArray{
 * 					exampleActionGroup.ID(),
 * 				},
 * 				CustomProperties: pulumi.StringMap{
 * 					"key":  pulumi.String("value"),
 * 					"key2": pulumi.String("value2"),
 * 				},
 * 			},
 * 			Identity: &monitoring.ScheduledQueryRulesAlertV2IdentityArgs{
 * 				Type: pulumi.String("UserAssigned"),
 * 				IdentityIds: pulumi.StringArray{
 * 					exampleUserAssignedIdentity.ID(),
 * 				},
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"key":  pulumi.String("value"),
 * 				"key2": pulumi.String("value2"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```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.appinsights.Insights;
 * import com.pulumi.azure.appinsights.InsightsArgs;
 * import com.pulumi.azure.monitoring.ActionGroup;
 * import com.pulumi.azure.monitoring.ActionGroupArgs;
 * import com.pulumi.azure.authorization.UserAssignedIdentity;
 * import com.pulumi.azure.authorization.UserAssignedIdentityArgs;
 * import com.pulumi.azure.authorization.Assignment;
 * import com.pulumi.azure.authorization.AssignmentArgs;
 * import com.pulumi.azure.monitoring.ScheduledQueryRulesAlertV2;
 * import com.pulumi.azure.monitoring.ScheduledQueryRulesAlertV2Args;
 * import com.pulumi.azure.monitoring.inputs.ScheduledQueryRulesAlertV2CriteriaArgs;
 * import com.pulumi.azure.monitoring.inputs.ScheduledQueryRulesAlertV2CriteriaFailingPeriodsArgs;
 * import com.pulumi.azure.monitoring.inputs.ScheduledQueryRulesAlertV2ActionArgs;
 * import com.pulumi.azure.monitoring.inputs.ScheduledQueryRulesAlertV2IdentityArgs;
 * 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("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
 *             .name("example-ai")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .applicationType("web")
 *             .build());
 *         var exampleActionGroup = new ActionGroup("exampleActionGroup", ActionGroupArgs.builder()
 *             .name("example-mag")
 *             .resourceGroupName(example.name())
 *             .shortName("test mag")
 *             .build());
 *         var exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()
 *             .name("example-uai")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 *         var exampleAssignment = new Assignment("exampleAssignment", AssignmentArgs.builder()
 *             .scope(exampleInsights.id())
 *             .roleDefinitionName("Reader")
 *             .principalId(exampleUserAssignedIdentity.principalId())
 *             .build());
 *         var exampleScheduledQueryRulesAlertV2 = new ScheduledQueryRulesAlertV2("exampleScheduledQueryRulesAlertV2", ScheduledQueryRulesAlertV2Args.builder()
 *             .name("example-msqrv2")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .evaluationFrequency("PT10M")
 *             .windowDuration("PT10M")
 *             .scopes(exampleInsights.id())
 *             .severity(4)
 *             .criterias(ScheduledQueryRulesAlertV2CriteriaArgs.builder()
 *                 .query("""
 * requests
 *   | summarize CountByCountry=count() by client_CountryOrRegion
 *                 """)
 *                 .timeAggregationMethod("Maximum")
 *                 .threshold(17.5)
 *                 .operator("LessThan")
 *                 .resourceIdColumn("client_CountryOrRegion")
 *                 .metricMeasureColumn("CountByCountry")
 *                 .dimensions(ScheduledQueryRulesAlertV2CriteriaDimensionArgs.builder()
 *                     .name("client_CountryOrRegion")
 *                     .operator("Exclude")
 *                     .values("123")
 *                     .build())
 *                 .failingPeriods(ScheduledQueryRulesAlertV2CriteriaFailingPeriodsArgs.builder()
 *                     .minimumFailingPeriodsToTriggerAlert(1)
 *                     .numberOfEvaluationPeriods(1)
 *                     .build())
 *                 .build())
 *             .autoMitigationEnabled(true)
 *             .workspaceAlertsStorageEnabled(false)
 *             .description("example sqr")
 *             .displayName("example-sqr")
 *             .enabled(true)
 *             .queryTimeRangeOverride("PT1H")
 *             .skipQueryValidation(true)
 *             .action(ScheduledQueryRulesAlertV2ActionArgs.builder()
 *                 .actionGroups(exampleActionGroup.id())
 *                 .customProperties(Map.ofEntries(
 *                     Map.entry("key", "value"),
 *                     Map.entry("key2", "value2")
 *                 ))
 *                 .build())
 *             .identity(ScheduledQueryRulesAlertV2IdentityArgs.builder()
 *                 .type("UserAssigned")
 *                 .identityIds(exampleUserAssignedIdentity.id())
 *                 .build())
 *             .tags(Map.ofEntries(
 *                 Map.entry("key", "value"),
 *                 Map.entry("key2", "value2")
 *             ))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleInsights:
 *     type: azure:appinsights:Insights
 *     name: example
 *     properties:
 *       name: example-ai
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       applicationType: web
 *   exampleActionGroup:
 *     type: azure:monitoring:ActionGroup
 *     name: example
 *     properties:
 *       name: example-mag
 *       resourceGroupName: ${example.name}
 *       shortName: test mag
 *   exampleUserAssignedIdentity:
 *     type: azure:authorization:UserAssignedIdentity
 *     name: example
 *     properties:
 *       name: example-uai
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *   exampleAssignment:
 *     type: azure:authorization:Assignment
 *     name: example
 *     properties:
 *       scope: ${exampleInsights.id}
 *       roleDefinitionName: Reader
 *       principalId: ${exampleUserAssignedIdentity.principalId}
 *   exampleScheduledQueryRulesAlertV2:
 *     type: azure:monitoring:ScheduledQueryRulesAlertV2
 *     name: example
 *     properties:
 *       name: example-msqrv2
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       evaluationFrequency: PT10M
 *       windowDuration: PT10M
 *       scopes: ${exampleInsights.id}
 *       severity: 4
 *       criterias:
 *         - query: |
 *             requests
 *               | summarize CountByCountry=count() by client_CountryOrRegion
 *           timeAggregationMethod: Maximum
 *           threshold: 17.5
 *           operator: LessThan
 *           resourceIdColumn: client_CountryOrRegion
 *           metricMeasureColumn: CountByCountry
 *           dimensions:
 *             - name: client_CountryOrRegion
 *               operator: Exclude
 *               values:
 *                 - '123'
 *           failingPeriods:
 *             minimumFailingPeriodsToTriggerAlert: 1
 *             numberOfEvaluationPeriods: 1
 *       autoMitigationEnabled: true
 *       workspaceAlertsStorageEnabled: false
 *       description: example sqr
 *       displayName: example-sqr
 *       enabled: true
 *       queryTimeRangeOverride: PT1H
 *       skipQueryValidation: true
 *       action:
 *         actionGroups:
 *           - ${exampleActionGroup.id}
 *         customProperties:
 *           key: value
 *           key2: value2
 *       identity:
 *         type: UserAssigned
 *         identityIds:
 *           - ${exampleUserAssignedIdentity.id}
 *       tags:
 *         key: value
 *         key2: value2
 * ```
 * 
 * ## Import
 * Monitor Scheduled Query Rule Alert can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:monitoring/scheduledQueryRulesAlertV2:ScheduledQueryRulesAlertV2 example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Insights/scheduledQueryRules/rule1
 * ```
 * @property action An `action` block as defined below.
 * @property autoMitigationEnabled Specifies the flag that indicates whether the alert should be automatically resolved or not. Value should be `true` or `false`. The default is `false`.
 * @property criterias A `criteria` block as defined below.
 * @property description Specifies the description of the scheduled query rule.
 * @property displayName Specifies the display name of the alert rule.
 * @property enabled Specifies the flag which indicates whether this scheduled query rule is enabled. Value should be `true` or `false`. Defaults to `true`.
 * @property evaluationFrequency How often the scheduled query rule is evaluated, represented in ISO 8601 duration format. Possible values are `PT1M`, `PT5M`, `PT10M`, `PT15M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, `PT6H`, `P1D`.
 * > **Note** `evaluation_frequency` cannot be greater than the query look back which is `window_duration`*`number_of_evaluation_periods`.
 * > **Note** `evaluation_frequency` cannot be greater than the `mute_actions_after_alert_duration`.
 * @property identity An `identity` block as defined below.
 * @property location Specifies the Azure Region where the Monitor Scheduled Query Rule should exist. Changing this forces a new resource to be created.
 * @property muteActionsAfterAlertDuration Mute actions for the chosen period of time in ISO 8601 duration format after the alert is fired. Possible values are `PT5M`, `PT10M`, `PT15M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, `PT6H`, `P1D` and `P2D`.
 * > **Note** `auto_mitigation_enabled` and `mute_actions_after_alert_duration` are mutually exclusive and cannot both be set.
 * @property name Specifies the name which should be used for this Monitor Scheduled Query Rule. Changing this forces a new resource to be created.
 * @property queryTimeRangeOverride Set this if the alert evaluation period is different from the query time range. If not specified, the value is `window_duration`*`number_of_evaluation_periods`. Possible values are `PT5M`, `PT10M`, `PT15M`, `PT20M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, `PT6H`, `P1D` and `P2D`.
 * > **Note** `query_time_range_override` cannot be less than the query look back which is `window_duration`*`number_of_evaluation_periods`.
 * @property resourceGroupName Specifies the name of the Resource Group where the Monitor Scheduled Query Rule should exist. Changing this forces a new resource to be created.
 * @property scopes Specifies the list of resource IDs that this scheduled query rule is scoped to. Changing this forces a new resource to be created. Currently, the API supports exactly 1 resource ID in the scopes list.
 * @property severity Severity of the alert. Should be an integer between 0 and 4. Value of 0 is severest.
 * @property skipQueryValidation Specifies the flag which indicates whether the provided query should be validated or not. The default is false.
 * @property tags A mapping of tags which should be assigned to the Monitor Scheduled Query Rule.
 * @property targetResourceTypes List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is `Microsoft.Compute/virtualMachines`, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria.
 * @property windowDuration Specifies the period of time in ISO 8601 duration format on which the Scheduled Query Rule will be executed (bin size). If `evaluation_frequency` is `PT1M`, possible values are `PT1M`, `PT5M`, `PT10M`, `PT15M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, and `PT6H`. Otherwise, possible values are `PT5M`, `PT10M`, `PT15M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, `PT6H`, `P1D`, and `P2D`.
 * @property workspaceAlertsStorageEnabled Specifies the flag which indicates whether this scheduled query rule check if storage is configured. Value should be `true` or `false`. The default is `false`.
 */
public data class ScheduledQueryRulesAlertV2Args(
    public val action: Output? = null,
    public val autoMitigationEnabled: Output? = null,
    public val criterias: Output>? = null,
    public val description: Output? = null,
    public val displayName: Output? = null,
    public val enabled: Output? = null,
    public val evaluationFrequency: Output? = null,
    public val identity: Output? = null,
    public val location: Output? = null,
    public val muteActionsAfterAlertDuration: Output? = null,
    public val name: Output? = null,
    public val queryTimeRangeOverride: Output? = null,
    public val resourceGroupName: Output? = null,
    public val scopes: Output? = null,
    public val severity: Output? = null,
    public val skipQueryValidation: Output? = null,
    public val tags: Output>? = null,
    public val targetResourceTypes: Output>? = null,
    public val windowDuration: Output? = null,
    public val workspaceAlertsStorageEnabled: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.monitoring.ScheduledQueryRulesAlertV2Args =
        com.pulumi.azure.monitoring.ScheduledQueryRulesAlertV2Args.builder()
            .action(action?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .autoMitigationEnabled(autoMitigationEnabled?.applyValue({ args0 -> args0 }))
            .criterias(
                criterias?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .description(description?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .evaluationFrequency(evaluationFrequency?.applyValue({ args0 -> args0 }))
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .muteActionsAfterAlertDuration(muteActionsAfterAlertDuration?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .queryTimeRangeOverride(queryTimeRangeOverride?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .scopes(scopes?.applyValue({ args0 -> args0 }))
            .severity(severity?.applyValue({ args0 -> args0 }))
            .skipQueryValidation(skipQueryValidation?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .targetResourceTypes(targetResourceTypes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .windowDuration(windowDuration?.applyValue({ args0 -> args0 }))
            .workspaceAlertsStorageEnabled(
                workspaceAlertsStorageEnabled?.applyValue({ args0 ->
                    args0
                }),
            ).build()
}

/**
 * Builder for [ScheduledQueryRulesAlertV2Args].
 */
@PulumiTagMarker
public class ScheduledQueryRulesAlertV2ArgsBuilder internal constructor() {
    private var action: Output? = null

    private var autoMitigationEnabled: Output? = null

    private var criterias: Output>? = null

    private var description: Output? = null

    private var displayName: Output? = null

    private var enabled: Output? = null

    private var evaluationFrequency: Output? = null

    private var identity: Output? = null

    private var location: Output? = null

    private var muteActionsAfterAlertDuration: Output? = null

    private var name: Output? = null

    private var queryTimeRangeOverride: Output? = null

    private var resourceGroupName: Output? = null

    private var scopes: Output? = null

    private var severity: Output? = null

    private var skipQueryValidation: Output? = null

    private var tags: Output>? = null

    private var targetResourceTypes: Output>? = null

    private var windowDuration: Output? = null

    private var workspaceAlertsStorageEnabled: Output? = null

    /**
     * @param value An `action` block as defined below.
     */
    @JvmName("iindykyhdipleify")
    public suspend fun action(`value`: Output) {
        this.action = value
    }

    /**
     * @param value Specifies the flag that indicates whether the alert should be automatically resolved or not. Value should be `true` or `false`. The default is `false`.
     */
    @JvmName("nuogyhmcgufgpkbh")
    public suspend fun autoMitigationEnabled(`value`: Output) {
        this.autoMitigationEnabled = value
    }

    /**
     * @param value A `criteria` block as defined below.
     */
    @JvmName("iahsgjobgidvkodd")
    public suspend fun criterias(`value`: Output>) {
        this.criterias = value
    }

    @JvmName("yurdbaaehcbwggyx")
    public suspend fun criterias(vararg values: Output) {
        this.criterias = Output.all(values.asList())
    }

    /**
     * @param values A `criteria` block as defined below.
     */
    @JvmName("ubvdiecqcwtqbbqv")
    public suspend fun criterias(values: List>) {
        this.criterias = Output.all(values)
    }

    /**
     * @param value Specifies the description of the scheduled query rule.
     */
    @JvmName("vcwnccrajqycbjqp")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Specifies the display name of the alert rule.
     */
    @JvmName("ybsopekhxtiwcuuk")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value Specifies the flag which indicates whether this scheduled query rule is enabled. Value should be `true` or `false`. Defaults to `true`.
     */
    @JvmName("hsixcyfjqrflxikr")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value How often the scheduled query rule is evaluated, represented in ISO 8601 duration format. Possible values are `PT1M`, `PT5M`, `PT10M`, `PT15M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, `PT6H`, `P1D`.
     * > **Note** `evaluation_frequency` cannot be greater than the query look back which is `window_duration`*`number_of_evaluation_periods`.
     * > **Note** `evaluation_frequency` cannot be greater than the `mute_actions_after_alert_duration`.
     */
    @JvmName("xlgvnahklatiylja")
    public suspend fun evaluationFrequency(`value`: Output) {
        this.evaluationFrequency = value
    }

    /**
     * @param value An `identity` block as defined below.
     */
    @JvmName("whnojucjlywwqncl")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

    /**
     * @param value Specifies the Azure Region where the Monitor Scheduled Query Rule should exist. Changing this forces a new resource to be created.
     */
    @JvmName("xmqonmjlmmeljrlt")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Mute actions for the chosen period of time in ISO 8601 duration format after the alert is fired. Possible values are `PT5M`, `PT10M`, `PT15M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, `PT6H`, `P1D` and `P2D`.
     * > **Note** `auto_mitigation_enabled` and `mute_actions_after_alert_duration` are mutually exclusive and cannot both be set.
     */
    @JvmName("sohsyqhfqyvcpfad")
    public suspend fun muteActionsAfterAlertDuration(`value`: Output) {
        this.muteActionsAfterAlertDuration = value
    }

    /**
     * @param value Specifies the name which should be used for this Monitor Scheduled Query Rule. Changing this forces a new resource to be created.
     */
    @JvmName("sojgjubgwsnjuqpc")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Set this if the alert evaluation period is different from the query time range. If not specified, the value is `window_duration`*`number_of_evaluation_periods`. Possible values are `PT5M`, `PT10M`, `PT15M`, `PT20M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, `PT6H`, `P1D` and `P2D`.
     * > **Note** `query_time_range_override` cannot be less than the query look back which is `window_duration`*`number_of_evaluation_periods`.
     */
    @JvmName("jqtyxfpgtjrucgun")
    public suspend fun queryTimeRangeOverride(`value`: Output) {
        this.queryTimeRangeOverride = value
    }

    /**
     * @param value Specifies the name of the Resource Group where the Monitor Scheduled Query Rule should exist. Changing this forces a new resource to be created.
     */
    @JvmName("tieygvmycplmswff")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Specifies the list of resource IDs that this scheduled query rule is scoped to. Changing this forces a new resource to be created. Currently, the API supports exactly 1 resource ID in the scopes list.
     */
    @JvmName("kfxyjagvwotvvayy")
    public suspend fun scopes(`value`: Output) {
        this.scopes = value
    }

    /**
     * @param value Severity of the alert. Should be an integer between 0 and 4. Value of 0 is severest.
     */
    @JvmName("fxfwyetigteqquuy")
    public suspend fun severity(`value`: Output) {
        this.severity = value
    }

    /**
     * @param value Specifies the flag which indicates whether the provided query should be validated or not. The default is false.
     */
    @JvmName("irlmdvbueprhjggy")
    public suspend fun skipQueryValidation(`value`: Output) {
        this.skipQueryValidation = value
    }

    /**
     * @param value A mapping of tags which should be assigned to the Monitor Scheduled Query Rule.
     */
    @JvmName("idavpdbewqfhnphg")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is `Microsoft.Compute/virtualMachines`, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria.
     */
    @JvmName("yftvgtclkaudbrdb")
    public suspend fun targetResourceTypes(`value`: Output>) {
        this.targetResourceTypes = value
    }

    @JvmName("pumydgunfvkwjyph")
    public suspend fun targetResourceTypes(vararg values: Output) {
        this.targetResourceTypes = Output.all(values.asList())
    }

    /**
     * @param values List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is `Microsoft.Compute/virtualMachines`, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria.
     */
    @JvmName("dafldovqppgjfvmo")
    public suspend fun targetResourceTypes(values: List>) {
        this.targetResourceTypes = Output.all(values)
    }

    /**
     * @param value Specifies the period of time in ISO 8601 duration format on which the Scheduled Query Rule will be executed (bin size). If `evaluation_frequency` is `PT1M`, possible values are `PT1M`, `PT5M`, `PT10M`, `PT15M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, and `PT6H`. Otherwise, possible values are `PT5M`, `PT10M`, `PT15M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, `PT6H`, `P1D`, and `P2D`.
     */
    @JvmName("bikwwxwvumkcqvei")
    public suspend fun windowDuration(`value`: Output) {
        this.windowDuration = value
    }

    /**
     * @param value Specifies the flag which indicates whether this scheduled query rule check if storage is configured. Value should be `true` or `false`. The default is `false`.
     */
    @JvmName("oftcoavyjpfbptqa")
    public suspend fun workspaceAlertsStorageEnabled(`value`: Output) {
        this.workspaceAlertsStorageEnabled = value
    }

    /**
     * @param value An `action` block as defined below.
     */
    @JvmName("lwtmhulfewkfqyyj")
    public suspend fun action(`value`: ScheduledQueryRulesAlertV2ActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.action = mapped
    }

    /**
     * @param argument An `action` block as defined below.
     */
    @JvmName("enctytsrvbjvilkp")
    public suspend
    fun action(argument: suspend ScheduledQueryRulesAlertV2ActionArgsBuilder.() -> Unit) {
        val toBeMapped = ScheduledQueryRulesAlertV2ActionArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.action = mapped
    }

    /**
     * @param value Specifies the flag that indicates whether the alert should be automatically resolved or not. Value should be `true` or `false`. The default is `false`.
     */
    @JvmName("fkgkyvksmnucspkf")
    public suspend fun autoMitigationEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.autoMitigationEnabled = mapped
    }

    /**
     * @param value A `criteria` block as defined below.
     */
    @JvmName("rhfuxblyusbbyfkd")
    public suspend fun criterias(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.criterias = mapped
    }

    /**
     * @param argument A `criteria` block as defined below.
     */
    @JvmName("wwebnusxkoisldss")
    public suspend
    fun criterias(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ScheduledQueryRulesAlertV2CriteriaArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.criterias = mapped
    }

    /**
     * @param argument A `criteria` block as defined below.
     */
    @JvmName("mkpyfixfaredoqlo")
    public suspend fun criterias(
        vararg
        argument: suspend ScheduledQueryRulesAlertV2CriteriaArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            ScheduledQueryRulesAlertV2CriteriaArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.criterias = mapped
    }

    /**
     * @param argument A `criteria` block as defined below.
     */
    @JvmName("dolokqdoessbvtix")
    public suspend
    fun criterias(argument: suspend ScheduledQueryRulesAlertV2CriteriaArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ScheduledQueryRulesAlertV2CriteriaArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.criterias = mapped
    }

    /**
     * @param values A `criteria` block as defined below.
     */
    @JvmName("kyophmonnnwwixtk")
    public suspend fun criterias(vararg values: ScheduledQueryRulesAlertV2CriteriaArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.criterias = mapped
    }

    /**
     * @param value Specifies the description of the scheduled query rule.
     */
    @JvmName("yoiauagrsegwkdco")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Specifies the display name of the alert rule.
     */
    @JvmName("qsgmhqxebsaoxlhd")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value Specifies the flag which indicates whether this scheduled query rule is enabled. Value should be `true` or `false`. Defaults to `true`.
     */
    @JvmName("npoksdvjbhcduuxe")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value How often the scheduled query rule is evaluated, represented in ISO 8601 duration format. Possible values are `PT1M`, `PT5M`, `PT10M`, `PT15M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, `PT6H`, `P1D`.
     * > **Note** `evaluation_frequency` cannot be greater than the query look back which is `window_duration`*`number_of_evaluation_periods`.
     * > **Note** `evaluation_frequency` cannot be greater than the `mute_actions_after_alert_duration`.
     */
    @JvmName("yvwmqwpchtiffkif")
    public suspend fun evaluationFrequency(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.evaluationFrequency = mapped
    }

    /**
     * @param value An `identity` block as defined below.
     */
    @JvmName("syrlpwyntgwkqeti")
    public suspend fun identity(`value`: ScheduledQueryRulesAlertV2IdentityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

    /**
     * @param argument An `identity` block as defined below.
     */
    @JvmName("lfhclerwtyhagaqo")
    public suspend
    fun identity(argument: suspend ScheduledQueryRulesAlertV2IdentityArgsBuilder.() -> Unit) {
        val toBeMapped = ScheduledQueryRulesAlertV2IdentityArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

    /**
     * @param value Specifies the Azure Region where the Monitor Scheduled Query Rule should exist. Changing this forces a new resource to be created.
     */
    @JvmName("jvgedepfrybdmsaq")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Mute actions for the chosen period of time in ISO 8601 duration format after the alert is fired. Possible values are `PT5M`, `PT10M`, `PT15M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, `PT6H`, `P1D` and `P2D`.
     * > **Note** `auto_mitigation_enabled` and `mute_actions_after_alert_duration` are mutually exclusive and cannot both be set.
     */
    @JvmName("ejxntudaqhpndkju")
    public suspend fun muteActionsAfterAlertDuration(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.muteActionsAfterAlertDuration = mapped
    }

    /**
     * @param value Specifies the name which should be used for this Monitor Scheduled Query Rule. Changing this forces a new resource to be created.
     */
    @JvmName("gbmlptarmlmmgfpx")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Set this if the alert evaluation period is different from the query time range. If not specified, the value is `window_duration`*`number_of_evaluation_periods`. Possible values are `PT5M`, `PT10M`, `PT15M`, `PT20M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, `PT6H`, `P1D` and `P2D`.
     * > **Note** `query_time_range_override` cannot be less than the query look back which is `window_duration`*`number_of_evaluation_periods`.
     */
    @JvmName("jmijdobpoybudgdg")
    public suspend fun queryTimeRangeOverride(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.queryTimeRangeOverride = mapped
    }

    /**
     * @param value Specifies the name of the Resource Group where the Monitor Scheduled Query Rule should exist. Changing this forces a new resource to be created.
     */
    @JvmName("ipipiapyflcdikvl")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Specifies the list of resource IDs that this scheduled query rule is scoped to. Changing this forces a new resource to be created. Currently, the API supports exactly 1 resource ID in the scopes list.
     */
    @JvmName("woqwmelaefkdhnot")
    public suspend fun scopes(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scopes = mapped
    }

    /**
     * @param value Severity of the alert. Should be an integer between 0 and 4. Value of 0 is severest.
     */
    @JvmName("dyaogmytjrmvcyba")
    public suspend fun severity(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.severity = mapped
    }

    /**
     * @param value Specifies the flag which indicates whether the provided query should be validated or not. The default is false.
     */
    @JvmName("qkayyhcdbilugakp")
    public suspend fun skipQueryValidation(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.skipQueryValidation = mapped
    }

    /**
     * @param value A mapping of tags which should be assigned to the Monitor Scheduled Query Rule.
     */
    @JvmName("ksofgifgyuleatpi")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags which should be assigned to the Monitor Scheduled Query Rule.
     */
    @JvmName("oypueaxugaqrmphv")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is `Microsoft.Compute/virtualMachines`, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria.
     */
    @JvmName("rphfrcxcguuvyxif")
    public suspend fun targetResourceTypes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetResourceTypes = mapped
    }

    /**
     * @param values List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is `Microsoft.Compute/virtualMachines`, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria.
     */
    @JvmName("rifbxpbmwfwscuxn")
    public suspend fun targetResourceTypes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.targetResourceTypes = mapped
    }

    /**
     * @param value Specifies the period of time in ISO 8601 duration format on which the Scheduled Query Rule will be executed (bin size). If `evaluation_frequency` is `PT1M`, possible values are `PT1M`, `PT5M`, `PT10M`, `PT15M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, and `PT6H`. Otherwise, possible values are `PT5M`, `PT10M`, `PT15M`, `PT30M`, `PT45M`, `PT1H`, `PT2H`, `PT3H`, `PT4H`, `PT5H`, `PT6H`, `P1D`, and `P2D`.
     */
    @JvmName("uxnkixiufyofaunl")
    public suspend fun windowDuration(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.windowDuration = mapped
    }

    /**
     * @param value Specifies the flag which indicates whether this scheduled query rule check if storage is configured. Value should be `true` or `false`. The default is `false`.
     */
    @JvmName("ttxgspikbgkwltfq")
    public suspend fun workspaceAlertsStorageEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.workspaceAlertsStorageEnabled = mapped
    }

    internal fun build(): ScheduledQueryRulesAlertV2Args = ScheduledQueryRulesAlertV2Args(
        action = action,
        autoMitigationEnabled = autoMitigationEnabled,
        criterias = criterias,
        description = description,
        displayName = displayName,
        enabled = enabled,
        evaluationFrequency = evaluationFrequency,
        identity = identity,
        location = location,
        muteActionsAfterAlertDuration = muteActionsAfterAlertDuration,
        name = name,
        queryTimeRangeOverride = queryTimeRangeOverride,
        resourceGroupName = resourceGroupName,
        scopes = scopes,
        severity = severity,
        skipQueryValidation = skipQueryValidation,
        tags = tags,
        targetResourceTypes = targetResourceTypes,
        windowDuration = windowDuration,
        workspaceAlertsStorageEnabled = workspaceAlertsStorageEnabled,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy