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

com.pulumi.azurenative.insights.kotlin.ScheduledQueryRuleArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.insights.kotlin

import com.pulumi.azurenative.insights.ScheduledQueryRuleArgs.builder
import com.pulumi.azurenative.insights.kotlin.enums.Kind
import com.pulumi.azurenative.insights.kotlin.inputs.ActionsArgs
import com.pulumi.azurenative.insights.kotlin.inputs.ActionsArgsBuilder
import com.pulumi.azurenative.insights.kotlin.inputs.IdentityArgs
import com.pulumi.azurenative.insights.kotlin.inputs.IdentityArgsBuilder
import com.pulumi.azurenative.insights.kotlin.inputs.RuleResolveConfigurationArgs
import com.pulumi.azurenative.insights.kotlin.inputs.RuleResolveConfigurationArgsBuilder
import com.pulumi.azurenative.insights.kotlin.inputs.ScheduledQueryRuleCriteriaArgs
import com.pulumi.azurenative.insights.kotlin.inputs.ScheduledQueryRuleCriteriaArgsBuilder
import com.pulumi.core.Either
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.Double
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * The scheduled query rule resource.
 * Azure REST API version: 2023-03-15-preview. Prior API version in Azure Native 1.x: 2018-04-16.
 * Other available API versions: 2018-04-16, 2020-05-01-preview, 2022-08-01-preview, 2023-12-01.
 * ## Example Usage
 * ### Create or update a scheduled query rule for Single Resource
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var scheduledQueryRule = new AzureNative.Insights.ScheduledQueryRule("scheduledQueryRule", new()
 *     {
 *         Actions = new AzureNative.Insights.Inputs.ActionsArgs
 *         {
 *             ActionGroups = new[]
 *             {
 *                 "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup",
 *             },
 *             CustomProperties =
 *             {
 *                 { "key11", "value11" },
 *                 { "key12", "value12" },
 *             },
 *         },
 *         CheckWorkspaceAlertsStorageConfigured = true,
 *         Criteria = new AzureNative.Insights.Inputs.ScheduledQueryRuleCriteriaArgs
 *         {
 *             AllOf = new[]
 *             {
 *                 new AzureNative.Insights.Inputs.ConditionArgs
 *                 {
 *                     Dimensions = new[]
 *                     {
 *                         new AzureNative.Insights.Inputs.DimensionArgs
 *                         {
 *                             Name = "ComputerIp",
 *                             Operator = AzureNative.Insights.DimensionOperator.Exclude,
 *                             Values = new[]
 *                             {
 *                                 "192.168.1.1",
 *                             },
 *                         },
 *                         new AzureNative.Insights.Inputs.DimensionArgs
 *                         {
 *                             Name = "OSType",
 *                             Operator = AzureNative.Insights.DimensionOperator.Include,
 *                             Values = new[]
 *                             {
 *                                 "*",
 *                             },
 *                         },
 *                     },
 *                     FailingPeriods = new AzureNative.Insights.Inputs.ConditionFailingPeriodsArgs
 *                     {
 *                         MinFailingPeriodsToAlert = 1,
 *                         NumberOfEvaluationPeriods = 1,
 *                     },
 *                     MetricMeasureColumn = "% Processor Time",
 *                     Operator = AzureNative.Insights.ConditionOperator.GreaterThan,
 *                     Query = "Perf | where ObjectName == \"Processor\"",
 *                     ResourceIdColumn = "resourceId",
 *                     Threshold = 70,
 *                     TimeAggregation = AzureNative.Insights.TimeAggregation.Average,
 *                 },
 *             },
 *         },
 *         Description = "Performance rule",
 *         Enabled = true,
 *         EvaluationFrequency = "PT5M",
 *         Location = "eastus",
 *         MuteActionsDuration = "PT30M",
 *         ResourceGroupName = "QueryResourceGroupName",
 *         RuleName = "perf",
 *         RuleResolveConfiguration = new AzureNative.Insights.Inputs.RuleResolveConfigurationArgs
 *         {
 *             AutoResolved = true,
 *             TimeToResolve = "PT10M",
 *         },
 *         Scopes = new[]
 *         {
 *             "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1",
 *         },
 *         Severity = 4,
 *         SkipQueryValidation = true,
 *         WindowSize = "PT10M",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	insights "github.com/pulumi/pulumi-azure-native-sdk/insights/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := insights.NewScheduledQueryRule(ctx, "scheduledQueryRule", &insights.ScheduledQueryRuleArgs{
 * 			Actions: &insights.ActionsArgs{
 * 				ActionGroups: pulumi.StringArray{
 * 					pulumi.String("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"),
 * 				},
 * 				CustomProperties: pulumi.StringMap{
 * 					"key11": pulumi.String("value11"),
 * 					"key12": pulumi.String("value12"),
 * 				},
 * 			},
 * 			CheckWorkspaceAlertsStorageConfigured: pulumi.Bool(true),
 * 			Criteria: &insights.ScheduledQueryRuleCriteriaArgs{
 * 				AllOf: insights.ConditionArray{
 * 					&insights.ConditionArgs{
 * 						Dimensions: insights.DimensionArray{
 * 							&insights.DimensionArgs{
 * 								Name:     pulumi.String("ComputerIp"),
 * 								Operator: pulumi.String(insights.DimensionOperatorExclude),
 * 								Values: pulumi.StringArray{
 * 									pulumi.String("192.168.1.1"),
 * 								},
 * 							},
 * 							&insights.DimensionArgs{
 * 								Name:     pulumi.String("OSType"),
 * 								Operator: pulumi.String(insights.DimensionOperatorInclude),
 * 								Values: pulumi.StringArray{
 * 									pulumi.String("*"),
 * 								},
 * 							},
 * 						},
 * 						FailingPeriods: &insights.ConditionFailingPeriodsArgs{
 * 							MinFailingPeriodsToAlert:  pulumi.Float64(1),
 * 							NumberOfEvaluationPeriods: pulumi.Float64(1),
 * 						},
 * 						MetricMeasureColumn: pulumi.String("% Processor Time"),
 * 						Operator:            pulumi.String(insights.ConditionOperatorGreaterThan),
 * 						Query:               pulumi.String("Perf | where ObjectName == \"Processor\""),
 * 						ResourceIdColumn:    pulumi.String("resourceId"),
 * 						Threshold:           pulumi.Float64(70),
 * 						TimeAggregation:     pulumi.String(insights.TimeAggregationAverage),
 * 					},
 * 				},
 * 			},
 * 			Description:         pulumi.String("Performance rule"),
 * 			Enabled:             pulumi.Bool(true),
 * 			EvaluationFrequency: pulumi.String("PT5M"),
 * 			Location:            pulumi.String("eastus"),
 * 			MuteActionsDuration: pulumi.String("PT30M"),
 * 			ResourceGroupName:   pulumi.String("QueryResourceGroupName"),
 * 			RuleName:            pulumi.String("perf"),
 * 			RuleResolveConfiguration: &insights.RuleResolveConfigurationArgs{
 * 				AutoResolved:  pulumi.Bool(true),
 * 				TimeToResolve: pulumi.String("PT10M"),
 * 			},
 * 			Scopes: pulumi.StringArray{
 * 				pulumi.String("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1"),
 * 			},
 * 			Severity:            pulumi.Float64(4),
 * 			SkipQueryValidation: pulumi.Bool(true),
 * 			WindowSize:          pulumi.String("PT10M"),
 * 		})
 * 		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.azurenative.insights.ScheduledQueryRule;
 * import com.pulumi.azurenative.insights.ScheduledQueryRuleArgs;
 * import com.pulumi.azurenative.insights.inputs.ActionsArgs;
 * import com.pulumi.azurenative.insights.inputs.ScheduledQueryRuleCriteriaArgs;
 * import com.pulumi.azurenative.insights.inputs.RuleResolveConfigurationArgs;
 * 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 scheduledQueryRule = new ScheduledQueryRule("scheduledQueryRule", ScheduledQueryRuleArgs.builder()
 *             .actions(ActionsArgs.builder()
 *                 .actionGroups("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")
 *                 .customProperties(Map.ofEntries(
 *                     Map.entry("key11", "value11"),
 *                     Map.entry("key12", "value12")
 *                 ))
 *                 .build())
 *             .checkWorkspaceAlertsStorageConfigured(true)
 *             .criteria(ScheduledQueryRuleCriteriaArgs.builder()
 *                 .allOf(ConditionArgs.builder()
 *                     .dimensions(
 *                         DimensionArgs.builder()
 *                             .name("ComputerIp")
 *                             .operator("Exclude")
 *                             .values("192.168.1.1")
 *                             .build(),
 *                         DimensionArgs.builder()
 *                             .name("OSType")
 *                             .operator("Include")
 *                             .values("*")
 *                             .build())
 *                     .failingPeriods(ConditionFailingPeriodsArgs.builder()
 *                         .minFailingPeriodsToAlert(1)
 *                         .numberOfEvaluationPeriods(1)
 *                         .build())
 *                     .metricMeasureColumn("% Processor Time")
 *                     .operator("GreaterThan")
 *                     .query("Perf | where ObjectName == \"Processor\"")
 *                     .resourceIdColumn("resourceId")
 *                     .threshold(70)
 *                     .timeAggregation("Average")
 *                     .build())
 *                 .build())
 *             .description("Performance rule")
 *             .enabled(true)
 *             .evaluationFrequency("PT5M")
 *             .location("eastus")
 *             .muteActionsDuration("PT30M")
 *             .resourceGroupName("QueryResourceGroupName")
 *             .ruleName("perf")
 *             .ruleResolveConfiguration(RuleResolveConfigurationArgs.builder()
 *                 .autoResolved(true)
 *                 .timeToResolve("PT10M")
 *                 .build())
 *             .scopes("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1/providers/Microsoft.Compute/virtualMachines/vm1")
 *             .severity(4)
 *             .skipQueryValidation(true)
 *             .windowSize("PT10M")
 *             .build());
 *     }
 * }
 * ```
 * ### Create or update a scheduled query rule on Resource group(s)
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var scheduledQueryRule = new AzureNative.Insights.ScheduledQueryRule("scheduledQueryRule", new()
 *     {
 *         Actions = new AzureNative.Insights.Inputs.ActionsArgs
 *         {
 *             ActionGroups = new[]
 *             {
 *                 "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup",
 *             },
 *             CustomProperties =
 *             {
 *                 { "key11", "value11" },
 *                 { "key12", "value12" },
 *             },
 *         },
 *         CheckWorkspaceAlertsStorageConfigured = true,
 *         Criteria = new AzureNative.Insights.Inputs.ScheduledQueryRuleCriteriaArgs
 *         {
 *             AllOf = new[]
 *             {
 *                 new AzureNative.Insights.Inputs.ConditionArgs
 *                 {
 *                     Dimensions = new() { },
 *                     FailingPeriods = new AzureNative.Insights.Inputs.ConditionFailingPeriodsArgs
 *                     {
 *                         MinFailingPeriodsToAlert = 1,
 *                         NumberOfEvaluationPeriods = 1,
 *                     },
 *                     Operator = AzureNative.Insights.ConditionOperator.GreaterThan,
 *                     Query = "Heartbeat",
 *                     Threshold = 360,
 *                     TimeAggregation = AzureNative.Insights.TimeAggregation.Count,
 *                 },
 *             },
 *         },
 *         Description = "Health check rule",
 *         Enabled = true,
 *         EvaluationFrequency = "PT5M",
 *         Location = "eastus",
 *         MuteActionsDuration = "PT30M",
 *         ResourceGroupName = "QueryResourceGroupName",
 *         RuleName = "heartbeat",
 *         RuleResolveConfiguration = new AzureNative.Insights.Inputs.RuleResolveConfigurationArgs
 *         {
 *             AutoResolved = true,
 *             TimeToResolve = "PT10M",
 *         },
 *         Scopes = new[]
 *         {
 *             "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1",
 *         },
 *         Severity = 4,
 *         SkipQueryValidation = true,
 *         TargetResourceTypes = new[]
 *         {
 *             "Microsoft.Compute/virtualMachines",
 *         },
 *         WindowSize = "PT10M",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	insights "github.com/pulumi/pulumi-azure-native-sdk/insights/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := insights.NewScheduledQueryRule(ctx, "scheduledQueryRule", &insights.ScheduledQueryRuleArgs{
 * 			Actions: &insights.ActionsArgs{
 * 				ActionGroups: pulumi.StringArray{
 * 					pulumi.String("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"),
 * 				},
 * 				CustomProperties: pulumi.StringMap{
 * 					"key11": pulumi.String("value11"),
 * 					"key12": pulumi.String("value12"),
 * 				},
 * 			},
 * 			CheckWorkspaceAlertsStorageConfigured: pulumi.Bool(true),
 * 			Criteria: &insights.ScheduledQueryRuleCriteriaArgs{
 * 				AllOf: insights.ConditionArray{
 * 					&insights.ConditionArgs{
 * 						Dimensions: insights.DimensionArray{},
 * 						FailingPeriods: &insights.ConditionFailingPeriodsArgs{
 * 							MinFailingPeriodsToAlert:  pulumi.Float64(1),
 * 							NumberOfEvaluationPeriods: pulumi.Float64(1),
 * 						},
 * 						Operator:        pulumi.String(insights.ConditionOperatorGreaterThan),
 * 						Query:           pulumi.String("Heartbeat"),
 * 						Threshold:       pulumi.Float64(360),
 * 						TimeAggregation: pulumi.String(insights.TimeAggregationCount),
 * 					},
 * 				},
 * 			},
 * 			Description:         pulumi.String("Health check rule"),
 * 			Enabled:             pulumi.Bool(true),
 * 			EvaluationFrequency: pulumi.String("PT5M"),
 * 			Location:            pulumi.String("eastus"),
 * 			MuteActionsDuration: pulumi.String("PT30M"),
 * 			ResourceGroupName:   pulumi.String("QueryResourceGroupName"),
 * 			RuleName:            pulumi.String("heartbeat"),
 * 			RuleResolveConfiguration: &insights.RuleResolveConfigurationArgs{
 * 				AutoResolved:  pulumi.Bool(true),
 * 				TimeToResolve: pulumi.String("PT10M"),
 * 			},
 * 			Scopes: pulumi.StringArray{
 * 				pulumi.String("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1"),
 * 			},
 * 			Severity:            pulumi.Float64(4),
 * 			SkipQueryValidation: pulumi.Bool(true),
 * 			TargetResourceTypes: pulumi.StringArray{
 * 				pulumi.String("Microsoft.Compute/virtualMachines"),
 * 			},
 * 			WindowSize: pulumi.String("PT10M"),
 * 		})
 * 		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.azurenative.insights.ScheduledQueryRule;
 * import com.pulumi.azurenative.insights.ScheduledQueryRuleArgs;
 * import com.pulumi.azurenative.insights.inputs.ActionsArgs;
 * import com.pulumi.azurenative.insights.inputs.ScheduledQueryRuleCriteriaArgs;
 * import com.pulumi.azurenative.insights.inputs.RuleResolveConfigurationArgs;
 * 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 scheduledQueryRule = new ScheduledQueryRule("scheduledQueryRule", ScheduledQueryRuleArgs.builder()
 *             .actions(ActionsArgs.builder()
 *                 .actionGroups("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")
 *                 .customProperties(Map.ofEntries(
 *                     Map.entry("key11", "value11"),
 *                     Map.entry("key12", "value12")
 *                 ))
 *                 .build())
 *             .checkWorkspaceAlertsStorageConfigured(true)
 *             .criteria(ScheduledQueryRuleCriteriaArgs.builder()
 *                 .allOf(ConditionArgs.builder()
 *                     .dimensions()
 *                     .failingPeriods(ConditionFailingPeriodsArgs.builder()
 *                         .minFailingPeriodsToAlert(1)
 *                         .numberOfEvaluationPeriods(1)
 *                         .build())
 *                     .operator("GreaterThan")
 *                     .query("Heartbeat")
 *                     .threshold(360)
 *                     .timeAggregation("Count")
 *                     .build())
 *                 .build())
 *             .description("Health check rule")
 *             .enabled(true)
 *             .evaluationFrequency("PT5M")
 *             .location("eastus")
 *             .muteActionsDuration("PT30M")
 *             .resourceGroupName("QueryResourceGroupName")
 *             .ruleName("heartbeat")
 *             .ruleResolveConfiguration(RuleResolveConfigurationArgs.builder()
 *                 .autoResolved(true)
 *                 .timeToResolve("PT10M")
 *                 .build())
 *             .scopes("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147/resourceGroups/scopeResourceGroup1")
 *             .severity(4)
 *             .skipQueryValidation(true)
 *             .targetResourceTypes("Microsoft.Compute/virtualMachines")
 *             .windowSize("PT10M")
 *             .build());
 *     }
 * }
 * ```
 * ### Create or update a scheduled query rule on Subscription
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var scheduledQueryRule = new AzureNative.Insights.ScheduledQueryRule("scheduledQueryRule", new()
 *     {
 *         Actions = new AzureNative.Insights.Inputs.ActionsArgs
 *         {
 *             ActionGroups = new[]
 *             {
 *                 "/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup",
 *             },
 *             CustomProperties =
 *             {
 *                 { "key11", "value11" },
 *                 { "key12", "value12" },
 *             },
 *         },
 *         CheckWorkspaceAlertsStorageConfigured = true,
 *         Criteria = new AzureNative.Insights.Inputs.ScheduledQueryRuleCriteriaArgs
 *         {
 *             AllOf = new[]
 *             {
 *                 new AzureNative.Insights.Inputs.ConditionArgs
 *                 {
 *                     Dimensions = new[]
 *                     {
 *                         new AzureNative.Insights.Inputs.DimensionArgs
 *                         {
 *                             Name = "ComputerIp",
 *                             Operator = AzureNative.Insights.DimensionOperator.Exclude,
 *                             Values = new[]
 *                             {
 *                                 "192.168.1.1",
 *                             },
 *                         },
 *                         new AzureNative.Insights.Inputs.DimensionArgs
 *                         {
 *                             Name = "OSType",
 *                             Operator = AzureNative.Insights.DimensionOperator.Include,
 *                             Values = new[]
 *                             {
 *                                 "*",
 *                             },
 *                         },
 *                     },
 *                     FailingPeriods = new AzureNative.Insights.Inputs.ConditionFailingPeriodsArgs
 *                     {
 *                         MinFailingPeriodsToAlert = 1,
 *                         NumberOfEvaluationPeriods = 1,
 *                     },
 *                     MetricMeasureColumn = "% Processor Time",
 *                     Operator = AzureNative.Insights.ConditionOperator.GreaterThan,
 *                     Query = "Perf | where ObjectName == \"Processor\"",
 *                     ResourceIdColumn = "resourceId",
 *                     Threshold = 70,
 *                     TimeAggregation = AzureNative.Insights.TimeAggregation.Average,
 *                 },
 *             },
 *         },
 *         Description = "Performance rule",
 *         Enabled = true,
 *         EvaluationFrequency = "PT5M",
 *         Location = "eastus",
 *         MuteActionsDuration = "PT30M",
 *         ResourceGroupName = "QueryResourceGroupName",
 *         RuleName = "perf",
 *         RuleResolveConfiguration = new AzureNative.Insights.Inputs.RuleResolveConfigurationArgs
 *         {
 *             AutoResolved = true,
 *             TimeToResolve = "PT10M",
 *         },
 *         Scopes = new[]
 *         {
 *             "/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147",
 *         },
 *         Severity = 4,
 *         SkipQueryValidation = true,
 *         TargetResourceTypes = new[]
 *         {
 *             "Microsoft.Compute/virtualMachines",
 *         },
 *         WindowSize = "PT10M",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	insights "github.com/pulumi/pulumi-azure-native-sdk/insights/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := insights.NewScheduledQueryRule(ctx, "scheduledQueryRule", &insights.ScheduledQueryRuleArgs{
 * 			Actions: &insights.ActionsArgs{
 * 				ActionGroups: pulumi.StringArray{
 * 					pulumi.String("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup"),
 * 				},
 * 				CustomProperties: pulumi.StringMap{
 * 					"key11": pulumi.String("value11"),
 * 					"key12": pulumi.String("value12"),
 * 				},
 * 			},
 * 			CheckWorkspaceAlertsStorageConfigured: pulumi.Bool(true),
 * 			Criteria: &insights.ScheduledQueryRuleCriteriaArgs{
 * 				AllOf: insights.ConditionArray{
 * 					&insights.ConditionArgs{
 * 						Dimensions: insights.DimensionArray{
 * 							&insights.DimensionArgs{
 * 								Name:     pulumi.String("ComputerIp"),
 * 								Operator: pulumi.String(insights.DimensionOperatorExclude),
 * 								Values: pulumi.StringArray{
 * 									pulumi.String("192.168.1.1"),
 * 								},
 * 							},
 * 							&insights.DimensionArgs{
 * 								Name:     pulumi.String("OSType"),
 * 								Operator: pulumi.String(insights.DimensionOperatorInclude),
 * 								Values: pulumi.StringArray{
 * 									pulumi.String("*"),
 * 								},
 * 							},
 * 						},
 * 						FailingPeriods: &insights.ConditionFailingPeriodsArgs{
 * 							MinFailingPeriodsToAlert:  pulumi.Float64(1),
 * 							NumberOfEvaluationPeriods: pulumi.Float64(1),
 * 						},
 * 						MetricMeasureColumn: pulumi.String("% Processor Time"),
 * 						Operator:            pulumi.String(insights.ConditionOperatorGreaterThan),
 * 						Query:               pulumi.String("Perf | where ObjectName == \"Processor\""),
 * 						ResourceIdColumn:    pulumi.String("resourceId"),
 * 						Threshold:           pulumi.Float64(70),
 * 						TimeAggregation:     pulumi.String(insights.TimeAggregationAverage),
 * 					},
 * 				},
 * 			},
 * 			Description:         pulumi.String("Performance rule"),
 * 			Enabled:             pulumi.Bool(true),
 * 			EvaluationFrequency: pulumi.String("PT5M"),
 * 			Location:            pulumi.String("eastus"),
 * 			MuteActionsDuration: pulumi.String("PT30M"),
 * 			ResourceGroupName:   pulumi.String("QueryResourceGroupName"),
 * 			RuleName:            pulumi.String("perf"),
 * 			RuleResolveConfiguration: &insights.RuleResolveConfigurationArgs{
 * 				AutoResolved:  pulumi.Bool(true),
 * 				TimeToResolve: pulumi.String("PT10M"),
 * 			},
 * 			Scopes: pulumi.StringArray{
 * 				pulumi.String("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147"),
 * 			},
 * 			Severity:            pulumi.Float64(4),
 * 			SkipQueryValidation: pulumi.Bool(true),
 * 			TargetResourceTypes: pulumi.StringArray{
 * 				pulumi.String("Microsoft.Compute/virtualMachines"),
 * 			},
 * 			WindowSize: pulumi.String("PT10M"),
 * 		})
 * 		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.azurenative.insights.ScheduledQueryRule;
 * import com.pulumi.azurenative.insights.ScheduledQueryRuleArgs;
 * import com.pulumi.azurenative.insights.inputs.ActionsArgs;
 * import com.pulumi.azurenative.insights.inputs.ScheduledQueryRuleCriteriaArgs;
 * import com.pulumi.azurenative.insights.inputs.RuleResolveConfigurationArgs;
 * 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 scheduledQueryRule = new ScheduledQueryRule("scheduledQueryRule", ScheduledQueryRuleArgs.builder()
 *             .actions(ActionsArgs.builder()
 *                 .actionGroups("/subscriptions/1cf177ed-1330-4692-80ea-fd3d7783b147/resourcegroups/sqrapi/providers/microsoft.insights/actiongroups/myactiongroup")
 *                 .customProperties(Map.ofEntries(
 *                     Map.entry("key11", "value11"),
 *                     Map.entry("key12", "value12")
 *                 ))
 *                 .build())
 *             .checkWorkspaceAlertsStorageConfigured(true)
 *             .criteria(ScheduledQueryRuleCriteriaArgs.builder()
 *                 .allOf(ConditionArgs.builder()
 *                     .dimensions(
 *                         DimensionArgs.builder()
 *                             .name("ComputerIp")
 *                             .operator("Exclude")
 *                             .values("192.168.1.1")
 *                             .build(),
 *                         DimensionArgs.builder()
 *                             .name("OSType")
 *                             .operator("Include")
 *                             .values("*")
 *                             .build())
 *                     .failingPeriods(ConditionFailingPeriodsArgs.builder()
 *                         .minFailingPeriodsToAlert(1)
 *                         .numberOfEvaluationPeriods(1)
 *                         .build())
 *                     .metricMeasureColumn("% Processor Time")
 *                     .operator("GreaterThan")
 *                     .query("Perf | where ObjectName == \"Processor\"")
 *                     .resourceIdColumn("resourceId")
 *                     .threshold(70)
 *                     .timeAggregation("Average")
 *                     .build())
 *                 .build())
 *             .description("Performance rule")
 *             .enabled(true)
 *             .evaluationFrequency("PT5M")
 *             .location("eastus")
 *             .muteActionsDuration("PT30M")
 *             .resourceGroupName("QueryResourceGroupName")
 *             .ruleName("perf")
 *             .ruleResolveConfiguration(RuleResolveConfigurationArgs.builder()
 *                 .autoResolved(true)
 *                 .timeToResolve("PT10M")
 *                 .build())
 *             .scopes("/subscriptions/aaf177ed-1330-a9f2-80ea-fd3d7783b147")
 *             .severity(4)
 *             .skipQueryValidation(true)
 *             .targetResourceTypes("Microsoft.Compute/virtualMachines")
 *             .windowSize("PT10M")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:insights:ScheduledQueryRule perf /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}
 * ```
 * @property actions Actions to invoke when the alert fires.
 * @property autoMitigate The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert.
 * @property checkWorkspaceAlertsStorageConfigured The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert.
 * @property criteria The rule criteria that defines the conditions of the scheduled query rule.
 * @property description The description of the scheduled query rule.
 * @property displayName The display name of the alert rule
 * @property enabled The flag which indicates whether this scheduled query rule is enabled. Value should be true or false
 * @property evaluationFrequency How often the scheduled query rule is evaluated represented in ISO 8601 duration format. Relevant and required only for rules of the kind LogAlert.
 * @property identity The identity of the resource.
 * @property kind Indicates the type of scheduled query rule. The default is LogAlert.
 * @property location The geo-location where the resource lives
 * @property muteActionsDuration Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired. Relevant only for rules of the kind LogAlert.
 * @property overrideQueryTimeRange If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert.
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 * @property ruleName The name of the rule.
 * @property ruleResolveConfiguration Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert.
 * @property scopes The list of resource id's that this scheduled query rule is scoped to.
 * @property severity Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert.
 * @property skipQueryValidation The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert.
 * @property tags Resource tags.
 * @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. Relevant only for rules of the kind LogAlert
 * @property windowSize The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert.
 */
public data class ScheduledQueryRuleArgs(
    public val actions: Output? = null,
    public val autoMitigate: Output? = null,
    public val checkWorkspaceAlertsStorageConfigured: Output? = null,
    public val criteria: 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 kind: Output>? = null,
    public val location: Output? = null,
    public val muteActionsDuration: Output? = null,
    public val overrideQueryTimeRange: Output? = null,
    public val resourceGroupName: Output? = null,
    public val ruleName: Output? = null,
    public val ruleResolveConfiguration: 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 windowSize: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.insights.ScheduledQueryRuleArgs =
        com.pulumi.azurenative.insights.ScheduledQueryRuleArgs.builder()
            .actions(actions?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .autoMitigate(autoMitigate?.applyValue({ args0 -> args0 }))
            .checkWorkspaceAlertsStorageConfigured(
                checkWorkspaceAlertsStorageConfigured?.applyValue({ args0 ->
                    args0
                }),
            )
            .criteria(criteria?.applyValue({ 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() }) }))
            .kind(
                kind?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .location(location?.applyValue({ args0 -> args0 }))
            .muteActionsDuration(muteActionsDuration?.applyValue({ args0 -> args0 }))
            .overrideQueryTimeRange(overrideQueryTimeRange?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .ruleName(ruleName?.applyValue({ args0 -> args0 }))
            .ruleResolveConfiguration(
                ruleResolveConfiguration?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .scopes(scopes?.applyValue({ args0 -> args0.map({ 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 }) }))
            .windowSize(windowSize?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ScheduledQueryRuleArgs].
 */
@PulumiTagMarker
public class ScheduledQueryRuleArgsBuilder internal constructor() {
    private var actions: Output? = null

    private var autoMitigate: Output? = null

    private var checkWorkspaceAlertsStorageConfigured: Output? = null

    private var criteria: 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 kind: Output>? = null

    private var location: Output? = null

    private var muteActionsDuration: Output? = null

    private var overrideQueryTimeRange: Output? = null

    private var resourceGroupName: Output? = null

    private var ruleName: Output? = null

    private var ruleResolveConfiguration: 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 windowSize: Output? = null

    /**
     * @param value Actions to invoke when the alert fires.
     */
    @JvmName("ensxgqvbouthohvt")
    public suspend fun actions(`value`: Output) {
        this.actions = value
    }

    /**
     * @param value The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("dkxmbtofsrkxxbpw")
    public suspend fun autoMitigate(`value`: Output) {
        this.autoMitigate = value
    }

    /**
     * @param value The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("cfehwkrvdokevdai")
    public suspend fun checkWorkspaceAlertsStorageConfigured(`value`: Output) {
        this.checkWorkspaceAlertsStorageConfigured = value
    }

    /**
     * @param value The rule criteria that defines the conditions of the scheduled query rule.
     */
    @JvmName("rllabwdjpfkedarg")
    public suspend fun criteria(`value`: Output) {
        this.criteria = value
    }

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

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

    /**
     * @param value The flag which indicates whether this scheduled query rule is enabled. Value should be true or false
     */
    @JvmName("ioybtpyqhtfoguix")
    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. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("ewhehwlbvsqcxbou")
    public suspend fun evaluationFrequency(`value`: Output) {
        this.evaluationFrequency = value
    }

    /**
     * @param value The identity of the resource.
     */
    @JvmName("wmbdpfhlvdbiraln")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

    /**
     * @param value Indicates the type of scheduled query rule. The default is LogAlert.
     */
    @JvmName("vlvwvcajnbyxktfm")
    public suspend fun kind(`value`: Output>) {
        this.kind = value
    }

    /**
     * @param value The geo-location where the resource lives
     */
    @JvmName("porgfdympoubsapb")
    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. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("wiujklrartpafylk")
    public suspend fun muteActionsDuration(`value`: Output) {
        this.muteActionsDuration = value
    }

    /**
     * @param value If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert.
     */
    @JvmName("bnsmswfixbnmaccj")
    public suspend fun overrideQueryTimeRange(`value`: Output) {
        this.overrideQueryTimeRange = value
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("mlqkjdmubftjebvg")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The name of the rule.
     */
    @JvmName("ordphwahdsvayyog")
    public suspend fun ruleName(`value`: Output) {
        this.ruleName = value
    }

    /**
     * @param value Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("qvmaybiivhkobojc")
    public suspend fun ruleResolveConfiguration(`value`: Output) {
        this.ruleResolveConfiguration = value
    }

    /**
     * @param value The list of resource id's that this scheduled query rule is scoped to.
     */
    @JvmName("ilsimxhtacfiphso")
    public suspend fun scopes(`value`: Output>) {
        this.scopes = value
    }

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

    /**
     * @param values The list of resource id's that this scheduled query rule is scoped to.
     */
    @JvmName("bnuedtwkxiyfvfep")
    public suspend fun scopes(values: List>) {
        this.scopes = Output.all(values)
    }

    /**
     * @param value Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("fjwjikbgkbyjfpty")
    public suspend fun severity(`value`: Output) {
        this.severity = value
    }

    /**
     * @param value The flag which indicates whether the provided query should be validated or not. The default is false. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("wungqyygamdoynkh")
    public suspend fun skipQueryValidation(`value`: Output) {
        this.skipQueryValidation = value
    }

    /**
     * @param value Resource tags.
     */
    @JvmName("iojneiacxnjlclwx")
    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. Relevant only for rules of the kind LogAlert
     */
    @JvmName("rgevadydxnggimmv")
    public suspend fun targetResourceTypes(`value`: Output>) {
        this.targetResourceTypes = value
    }

    @JvmName("ckjrvkdaiojxvwmt")
    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. Relevant only for rules of the kind LogAlert
     */
    @JvmName("eekyafyjrbyulsrr")
    public suspend fun targetResourceTypes(values: List>) {
        this.targetResourceTypes = Output.all(values)
    }

    /**
     * @param value The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("bewttqpcqqtbcqpo")
    public suspend fun windowSize(`value`: Output) {
        this.windowSize = value
    }

    /**
     * @param value Actions to invoke when the alert fires.
     */
    @JvmName("xdsxaaaxtapvugmc")
    public suspend fun actions(`value`: ActionsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.actions = mapped
    }

    /**
     * @param argument Actions to invoke when the alert fires.
     */
    @JvmName("mobilpnmxjwnfjqn")
    public suspend fun actions(argument: suspend ActionsArgsBuilder.() -> Unit) {
        val toBeMapped = ActionsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.actions = mapped
    }

    /**
     * @param value The flag that indicates whether the alert should be automatically resolved or not. The default is true. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("qdigcqkmywxmvuds")
    public suspend fun autoMitigate(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.autoMitigate = mapped
    }

    /**
     * @param value The flag which indicates whether this scheduled query rule should be stored in the customer's storage. The default is false. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("qtqwrwtefdfkftdy")
    public suspend fun checkWorkspaceAlertsStorageConfigured(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.checkWorkspaceAlertsStorageConfigured = mapped
    }

    /**
     * @param value The rule criteria that defines the conditions of the scheduled query rule.
     */
    @JvmName("bgkelncvfhlktvvc")
    public suspend fun criteria(`value`: ScheduledQueryRuleCriteriaArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.criteria = mapped
    }

    /**
     * @param argument The rule criteria that defines the conditions of the scheduled query rule.
     */
    @JvmName("pxlpfjvgauqceqlj")
    public suspend fun criteria(argument: suspend ScheduledQueryRuleCriteriaArgsBuilder.() -> Unit) {
        val toBeMapped = ScheduledQueryRuleCriteriaArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.criteria = mapped
    }

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

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

    /**
     * @param value The flag which indicates whether this scheduled query rule is enabled. Value should be true or false
     */
    @JvmName("hcprtphaifjyxyur")
    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. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("dpwpuobfwispnqko")
    public suspend fun evaluationFrequency(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.evaluationFrequency = mapped
    }

    /**
     * @param value The identity of the resource.
     */
    @JvmName("jpbmqkwttkpghnak")
    public suspend fun identity(`value`: IdentityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

    /**
     * @param argument The identity of the resource.
     */
    @JvmName("xiudqaackrmejfgo")
    public suspend fun identity(argument: suspend IdentityArgsBuilder.() -> Unit) {
        val toBeMapped = IdentityArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

    /**
     * @param value Indicates the type of scheduled query rule. The default is LogAlert.
     */
    @JvmName("oryuyartohskkjmg")
    public suspend fun kind(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.kind = mapped
    }

    /**
     * @param value Indicates the type of scheduled query rule. The default is LogAlert.
     */
    @JvmName("bmgdegdvfixiijhl")
    public fun kind(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.kind = mapped
    }

    /**
     * @param value Indicates the type of scheduled query rule. The default is LogAlert.
     */
    @JvmName("tnivkdbvnlujcpmh")
    public fun kind(`value`: Kind) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.kind = mapped
    }

    /**
     * @param value The geo-location where the resource lives
     */
    @JvmName("aemkljlxftrylyus")
    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. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("epkrhiletlfvkjhi")
    public suspend fun muteActionsDuration(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.muteActionsDuration = mapped
    }

    /**
     * @param value If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods). Relevant only for rules of the kind LogAlert.
     */
    @JvmName("sjwvssteniaxqqsk")
    public suspend fun overrideQueryTimeRange(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.overrideQueryTimeRange = mapped
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("bfbhewapvnnwqtfg")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

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

    /**
     * @param value Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("wdgkebckccdwofmp")
    public suspend fun ruleResolveConfiguration(`value`: RuleResolveConfigurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleResolveConfiguration = mapped
    }

    /**
     * @param argument Defines the configuration for resolving fired alerts. Relevant only for rules of the kind LogAlert.
     */
    @JvmName("gvfmnpnqjwrrfoia")
    public suspend fun ruleResolveConfiguration(argument: suspend RuleResolveConfigurationArgsBuilder.() -> Unit) {
        val toBeMapped = RuleResolveConfigurationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.ruleResolveConfiguration = mapped
    }

    /**
     * @param value The list of resource id's that this scheduled query rule is scoped to.
     */
    @JvmName("umlgqwmktwwnhrqq")
    public suspend fun scopes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scopes = mapped
    }

    /**
     * @param values The list of resource id's that this scheduled query rule is scoped to.
     */
    @JvmName("knekmspyulxdrqhh")
    public suspend fun scopes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.scopes = mapped
    }

    /**
     * @param value Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest. Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("wdcgaqywqgtostwb")
    public suspend fun severity(`value`: Double?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.severity = mapped
    }

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

    /**
     * @param value Resource tags.
     */
    @JvmName("csdiygqjrlrkkhev")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Resource tags.
     */
    @JvmName("mpyqpjqsuoyifqul")
    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. Relevant only for rules of the kind LogAlert
     */
    @JvmName("ajuaqrkxakdgugcw")
    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. Relevant only for rules of the kind LogAlert
     */
    @JvmName("nfjhkkmrffrajcec")
    public suspend fun targetResourceTypes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.targetResourceTypes = mapped
    }

    /**
     * @param value The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size). Relevant and required only for rules of the kind LogAlert.
     */
    @JvmName("lbotfcmkvjsjvlbx")
    public suspend fun windowSize(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.windowSize = mapped
    }

    internal fun build(): ScheduledQueryRuleArgs = ScheduledQueryRuleArgs(
        actions = actions,
        autoMitigate = autoMitigate,
        checkWorkspaceAlertsStorageConfigured = checkWorkspaceAlertsStorageConfigured,
        criteria = criteria,
        description = description,
        displayName = displayName,
        enabled = enabled,
        evaluationFrequency = evaluationFrequency,
        identity = identity,
        kind = kind,
        location = location,
        muteActionsDuration = muteActionsDuration,
        overrideQueryTimeRange = overrideQueryTimeRange,
        resourceGroupName = resourceGroupName,
        ruleName = ruleName,
        ruleResolveConfiguration = ruleResolveConfiguration,
        scopes = scopes,
        severity = severity,
        skipQueryValidation = skipQueryValidation,
        tags = tags,
        targetResourceTypes = targetResourceTypes,
        windowSize = windowSize,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy