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

com.pulumi.alicloud.arms.kotlin.DispatchRuleArgs.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: 3.62.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.alicloud.arms.kotlin

import com.pulumi.alicloud.arms.DispatchRuleArgs.builder
import com.pulumi.alicloud.arms.kotlin.inputs.DispatchRuleGroupRuleArgs
import com.pulumi.alicloud.arms.kotlin.inputs.DispatchRuleGroupRuleArgsBuilder
import com.pulumi.alicloud.arms.kotlin.inputs.DispatchRuleLabelMatchExpressionGridArgs
import com.pulumi.alicloud.arms.kotlin.inputs.DispatchRuleLabelMatchExpressionGridArgsBuilder
import com.pulumi.alicloud.arms.kotlin.inputs.DispatchRuleNotifyRuleArgs
import com.pulumi.alicloud.arms.kotlin.inputs.DispatchRuleNotifyRuleArgsBuilder
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a Application Real-Time Monitoring Service (ARMS) Alert Dispatch Rule resource.
 * For information about Application Real-Time Monitoring Service (ARMS) Alert Dispatch Rule and how to use it, see [What is Alert Dispatch_Rule](https://next.api.alibabacloud.com/document/ARMS/2019-08-08/CreateDispatchRule).
 * > **NOTE:** Available since v1.136.0.
 * ## Example Usage
 * Basic Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as alicloud from "@pulumi/alicloud";
 * const _default = new alicloud.arms.AlertContact("default", {
 *     alertContactName: "example_value",
 *     email: "[email protected]",
 * });
 * const defaultAlertContactGroup = new alicloud.arms.AlertContactGroup("default", {
 *     alertContactGroupName: "example_value",
 *     contactIds: [_default.id],
 * });
 * const defaultDispatchRule = new alicloud.arms.DispatchRule("default", {
 *     dispatchRuleName: "example_value",
 *     dispatchType: "CREATE_ALERT",
 *     groupRules: [{
 *         groupWaitTime: 5,
 *         groupInterval: 15,
 *         repeatInterval: 100,
 *         groupingFields: ["alertname"],
 *     }],
 *     labelMatchExpressionGrids: [{
 *         labelMatchExpressionGroups: [{
 *             labelMatchExpressions: [{
 *                 key: "_aliyun_arms_involvedObject_kind",
 *                 value: "app",
 *                 operator: "eq",
 *             }],
 *         }],
 *     }],
 *     notifyRules: [{
 *         notifyObjects: [
 *             {
 *                 notifyObjectId: _default.id,
 *                 notifyType: "ARMS_CONTACT",
 *                 name: "example_value",
 *             },
 *             {
 *                 notifyObjectId: defaultAlertContactGroup.id,
 *                 notifyType: "ARMS_CONTACT_GROUP",
 *                 name: "example_value",
 *             },
 *         ],
 *         notifyChannels: [
 *             "dingTalk",
 *             "wechat",
 *         ],
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_alicloud as alicloud
 * default = alicloud.arms.AlertContact("default",
 *     alert_contact_name="example_value",
 *     email="[email protected]")
 * default_alert_contact_group = alicloud.arms.AlertContactGroup("default",
 *     alert_contact_group_name="example_value",
 *     contact_ids=[default.id])
 * default_dispatch_rule = alicloud.arms.DispatchRule("default",
 *     dispatch_rule_name="example_value",
 *     dispatch_type="CREATE_ALERT",
 *     group_rules=[{
 *         "group_wait_time": 5,
 *         "group_interval": 15,
 *         "repeat_interval": 100,
 *         "grouping_fields": ["alertname"],
 *     }],
 *     label_match_expression_grids=[{
 *         "label_match_expression_groups": [{
 *             "label_match_expressions": [{
 *                 "key": "_aliyun_arms_involvedObject_kind",
 *                 "value": "app",
 *                 "operator": "eq",
 *             }],
 *         }],
 *     }],
 *     notify_rules=[{
 *         "notify_objects": [
 *             {
 *                 "notify_object_id": default.id,
 *                 "notify_type": "ARMS_CONTACT",
 *                 "name": "example_value",
 *             },
 *             {
 *                 "notify_object_id": default_alert_contact_group.id,
 *                 "notify_type": "ARMS_CONTACT_GROUP",
 *                 "name": "example_value",
 *             },
 *         ],
 *         "notify_channels": [
 *             "dingTalk",
 *             "wechat",
 *         ],
 *     }])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AliCloud = Pulumi.AliCloud;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new AliCloud.Arms.AlertContact("default", new()
 *     {
 *         AlertContactName = "example_value",
 *         Email = "[email protected]",
 *     });
 *     var defaultAlertContactGroup = new AliCloud.Arms.AlertContactGroup("default", new()
 *     {
 *         AlertContactGroupName = "example_value",
 *         ContactIds = new[]
 *         {
 *             @default.Id,
 *         },
 *     });
 *     var defaultDispatchRule = new AliCloud.Arms.DispatchRule("default", new()
 *     {
 *         DispatchRuleName = "example_value",
 *         DispatchType = "CREATE_ALERT",
 *         GroupRules = new[]
 *         {
 *             new AliCloud.Arms.Inputs.DispatchRuleGroupRuleArgs
 *             {
 *                 GroupWaitTime = 5,
 *                 GroupInterval = 15,
 *                 RepeatInterval = 100,
 *                 GroupingFields = new[]
 *                 {
 *                     "alertname",
 *                 },
 *             },
 *         },
 *         LabelMatchExpressionGrids = new[]
 *         {
 *             new AliCloud.Arms.Inputs.DispatchRuleLabelMatchExpressionGridArgs
 *             {
 *                 LabelMatchExpressionGroups = new[]
 *                 {
 *                     new AliCloud.Arms.Inputs.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArgs
 *                     {
 *                         LabelMatchExpressions = new[]
 *                         {
 *                             new AliCloud.Arms.Inputs.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArgs
 *                             {
 *                                 Key = "_aliyun_arms_involvedObject_kind",
 *                                 Value = "app",
 *                                 Operator = "eq",
 *                             },
 *                         },
 *                     },
 *                 },
 *             },
 *         },
 *         NotifyRules = new[]
 *         {
 *             new AliCloud.Arms.Inputs.DispatchRuleNotifyRuleArgs
 *             {
 *                 NotifyObjects = new[]
 *                 {
 *                     new AliCloud.Arms.Inputs.DispatchRuleNotifyRuleNotifyObjectArgs
 *                     {
 *                         NotifyObjectId = @default.Id,
 *                         NotifyType = "ARMS_CONTACT",
 *                         Name = "example_value",
 *                     },
 *                     new AliCloud.Arms.Inputs.DispatchRuleNotifyRuleNotifyObjectArgs
 *                     {
 *                         NotifyObjectId = defaultAlertContactGroup.Id,
 *                         NotifyType = "ARMS_CONTACT_GROUP",
 *                         Name = "example_value",
 *                     },
 *                 },
 *                 NotifyChannels = new[]
 *                 {
 *                     "dingTalk",
 *                     "wechat",
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/arms"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := arms.NewAlertContact(ctx, "default", &arms.AlertContactArgs{
 * 			AlertContactName: pulumi.String("example_value"),
 * 			Email:            pulumi.String("[email protected]"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultAlertContactGroup, err := arms.NewAlertContactGroup(ctx, "default", &arms.AlertContactGroupArgs{
 * 			AlertContactGroupName: pulumi.String("example_value"),
 * 			ContactIds: pulumi.StringArray{
 * 				_default.ID(),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = arms.NewDispatchRule(ctx, "default", &arms.DispatchRuleArgs{
 * 			DispatchRuleName: pulumi.String("example_value"),
 * 			DispatchType:     pulumi.String("CREATE_ALERT"),
 * 			GroupRules: arms.DispatchRuleGroupRuleArray{
 * 				&arms.DispatchRuleGroupRuleArgs{
 * 					GroupWaitTime:  pulumi.Int(5),
 * 					GroupInterval:  pulumi.Int(15),
 * 					RepeatInterval: pulumi.Int(100),
 * 					GroupingFields: pulumi.StringArray{
 * 						pulumi.String("alertname"),
 * 					},
 * 				},
 * 			},
 * 			LabelMatchExpressionGrids: arms.DispatchRuleLabelMatchExpressionGridArray{
 * 				&arms.DispatchRuleLabelMatchExpressionGridArgs{
 * 					LabelMatchExpressionGroups: arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArray{
 * 						&arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArgs{
 * 							LabelMatchExpressions: arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArray{
 * 								&arms.DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArgs{
 * 									Key:      pulumi.String("_aliyun_arms_involvedObject_kind"),
 * 									Value:    pulumi.String("app"),
 * 									Operator: pulumi.String("eq"),
 * 								},
 * 							},
 * 						},
 * 					},
 * 				},
 * 			},
 * 			NotifyRules: arms.DispatchRuleNotifyRuleArray{
 * 				&arms.DispatchRuleNotifyRuleArgs{
 * 					NotifyObjects: arms.DispatchRuleNotifyRuleNotifyObjectArray{
 * 						&arms.DispatchRuleNotifyRuleNotifyObjectArgs{
 * 							NotifyObjectId: _default.ID(),
 * 							NotifyType:     pulumi.String("ARMS_CONTACT"),
 * 							Name:           pulumi.String("example_value"),
 * 						},
 * 						&arms.DispatchRuleNotifyRuleNotifyObjectArgs{
 * 							NotifyObjectId: defaultAlertContactGroup.ID(),
 * 							NotifyType:     pulumi.String("ARMS_CONTACT_GROUP"),
 * 							Name:           pulumi.String("example_value"),
 * 						},
 * 					},
 * 					NotifyChannels: pulumi.StringArray{
 * 						pulumi.String("dingTalk"),
 * 						pulumi.String("wechat"),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		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.alicloud.arms.AlertContact;
 * import com.pulumi.alicloud.arms.AlertContactArgs;
 * import com.pulumi.alicloud.arms.AlertContactGroup;
 * import com.pulumi.alicloud.arms.AlertContactGroupArgs;
 * import com.pulumi.alicloud.arms.DispatchRule;
 * import com.pulumi.alicloud.arms.DispatchRuleArgs;
 * import com.pulumi.alicloud.arms.inputs.DispatchRuleGroupRuleArgs;
 * import com.pulumi.alicloud.arms.inputs.DispatchRuleLabelMatchExpressionGridArgs;
 * import com.pulumi.alicloud.arms.inputs.DispatchRuleNotifyRuleArgs;
 * 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 default_ = new AlertContact("default", AlertContactArgs.builder()
 *             .alertContactName("example_value")
 *             .email("[email protected]")
 *             .build());
 *         var defaultAlertContactGroup = new AlertContactGroup("defaultAlertContactGroup", AlertContactGroupArgs.builder()
 *             .alertContactGroupName("example_value")
 *             .contactIds(default_.id())
 *             .build());
 *         var defaultDispatchRule = new DispatchRule("defaultDispatchRule", DispatchRuleArgs.builder()
 *             .dispatchRuleName("example_value")
 *             .dispatchType("CREATE_ALERT")
 *             .groupRules(DispatchRuleGroupRuleArgs.builder()
 *                 .groupWaitTime(5)
 *                 .groupInterval(15)
 *                 .repeatInterval(100)
 *                 .groupingFields("alertname")
 *                 .build())
 *             .labelMatchExpressionGrids(DispatchRuleLabelMatchExpressionGridArgs.builder()
 *                 .labelMatchExpressionGroups(DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupArgs.builder()
 *                     .labelMatchExpressions(DispatchRuleLabelMatchExpressionGridLabelMatchExpressionGroupLabelMatchExpressionArgs.builder()
 *                         .key("_aliyun_arms_involvedObject_kind")
 *                         .value("app")
 *                         .operator("eq")
 *                         .build())
 *                     .build())
 *                 .build())
 *             .notifyRules(DispatchRuleNotifyRuleArgs.builder()
 *                 .notifyObjects(
 *                     DispatchRuleNotifyRuleNotifyObjectArgs.builder()
 *                         .notifyObjectId(default_.id())
 *                         .notifyType("ARMS_CONTACT")
 *                         .name("example_value")
 *                         .build(),
 *                     DispatchRuleNotifyRuleNotifyObjectArgs.builder()
 *                         .notifyObjectId(defaultAlertContactGroup.id())
 *                         .notifyType("ARMS_CONTACT_GROUP")
 *                         .name("example_value")
 *                         .build())
 *                 .notifyChannels(
 *                     "dingTalk",
 *                     "wechat")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: alicloud:arms:AlertContact
 *     properties:
 *       alertContactName: example_value
 *       email: [email protected]
 *   defaultAlertContactGroup:
 *     type: alicloud:arms:AlertContactGroup
 *     name: default
 *     properties:
 *       alertContactGroupName: example_value
 *       contactIds:
 *         - ${default.id}
 *   defaultDispatchRule:
 *     type: alicloud:arms:DispatchRule
 *     name: default
 *     properties:
 *       dispatchRuleName: example_value
 *       dispatchType: CREATE_ALERT
 *       groupRules:
 *         - groupWaitTime: 5
 *           groupInterval: 15
 *           repeatInterval: 100
 *           groupingFields:
 *             - alertname
 *       labelMatchExpressionGrids:
 *         - labelMatchExpressionGroups:
 *             - labelMatchExpressions:
 *                 - key: _aliyun_arms_involvedObject_kind
 *                   value: app
 *                   operator: eq
 *       notifyRules:
 *         - notifyObjects:
 *             - notifyObjectId: ${default.id}
 *               notifyType: ARMS_CONTACT
 *               name: example_value
 *             - notifyObjectId: ${defaultAlertContactGroup.id}
 *               notifyType: ARMS_CONTACT_GROUP
 *               name: example_value
 *           notifyChannels:
 *             - dingTalk
 *             - wechat
 * ```
 * 
 * ## Import
 * Application Real-Time Monitoring Service (ARMS) Alert Contact can be imported using the id, e.g.
 * ```sh
 * $ pulumi import alicloud:arms/dispatchRule:DispatchRule example 
 * ```
 * @property dispatchRuleName The name of the dispatch policy.
 * @property dispatchType The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
 * @property groupRules Sets the event group. See `group_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
 * @property isRecover Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
 * @property labelMatchExpressionGrids Sets the dispatch rule. See `label_match_expression_grid` below.
 * @property notifyRules Sets the notification rule. See `notify_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
 */
public data class DispatchRuleArgs(
    public val dispatchRuleName: Output? = null,
    public val dispatchType: Output? = null,
    public val groupRules: Output>? = null,
    public val isRecover: Output? = null,
    public val labelMatchExpressionGrids: Output>? =
        null,
    public val notifyRules: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.alicloud.arms.DispatchRuleArgs =
        com.pulumi.alicloud.arms.DispatchRuleArgs.builder()
            .dispatchRuleName(dispatchRuleName?.applyValue({ args0 -> args0 }))
            .dispatchType(dispatchType?.applyValue({ args0 -> args0 }))
            .groupRules(
                groupRules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .isRecover(isRecover?.applyValue({ args0 -> args0 }))
            .labelMatchExpressionGrids(
                labelMatchExpressionGrids?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .notifyRules(
                notifyRules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [DispatchRuleArgs].
 */
@PulumiTagMarker
public class DispatchRuleArgsBuilder internal constructor() {
    private var dispatchRuleName: Output? = null

    private var dispatchType: Output? = null

    private var groupRules: Output>? = null

    private var isRecover: Output? = null

    private var labelMatchExpressionGrids: Output>? =
        null

    private var notifyRules: Output>? = null

    /**
     * @param value The name of the dispatch policy.
     */
    @JvmName("bhblvjfdrfhshgah")
    public suspend fun dispatchRuleName(`value`: Output) {
        this.dispatchRuleName = value
    }

    /**
     * @param value The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
     */
    @JvmName("qjfculfkaviqmxlc")
    public suspend fun dispatchType(`value`: Output) {
        this.dispatchType = value
    }

    /**
     * @param value Sets the event group. See `group_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("kqftguluuqydylpa")
    public suspend fun groupRules(`value`: Output>) {
        this.groupRules = value
    }

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

    /**
     * @param values Sets the event group. See `group_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("qavpnrojtycalpyd")
    public suspend fun groupRules(values: List>) {
        this.groupRules = Output.all(values)
    }

    /**
     * @param value Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
     */
    @JvmName("khxtgmfinpgrwxcd")
    public suspend fun isRecover(`value`: Output) {
        this.isRecover = value
    }

    /**
     * @param value Sets the dispatch rule. See `label_match_expression_grid` below.
     */
    @JvmName("xwnkhxjxgwfmtguf")
    public suspend fun labelMatchExpressionGrids(`value`: Output>) {
        this.labelMatchExpressionGrids = value
    }

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

    /**
     * @param values Sets the dispatch rule. See `label_match_expression_grid` below.
     */
    @JvmName("drjwobviwrkmdpkb")
    public suspend fun labelMatchExpressionGrids(values: List>) {
        this.labelMatchExpressionGrids = Output.all(values)
    }

    /**
     * @param value Sets the notification rule. See `notify_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("cdthvhslunrbaspx")
    public suspend fun notifyRules(`value`: Output>) {
        this.notifyRules = value
    }

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

    /**
     * @param values Sets the notification rule. See `notify_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("fciqikjlikpqqxkx")
    public suspend fun notifyRules(values: List>) {
        this.notifyRules = Output.all(values)
    }

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

    /**
     * @param value The alert handling method. Valid values: CREATE_ALERT: generates an alert. DISCARD_ALERT: discards the alert event and generates no alert.
     */
    @JvmName("oahkaxhymvyannqg")
    public suspend fun dispatchType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dispatchType = mapped
    }

    /**
     * @param value Sets the event group. See `group_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("rqxrropibowerlef")
    public suspend fun groupRules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.groupRules = mapped
    }

    /**
     * @param argument Sets the event group. See `group_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("xaoadvfonfevsnta")
    public suspend fun groupRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DispatchRuleGroupRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.groupRules = mapped
    }

    /**
     * @param argument Sets the event group. See `group_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("tyansaqocfrrxwpg")
    public suspend fun groupRules(vararg argument: suspend DispatchRuleGroupRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            DispatchRuleGroupRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.groupRules = mapped
    }

    /**
     * @param argument Sets the event group. See `group_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("luotkdgplhujkhym")
    public suspend fun groupRules(argument: suspend DispatchRuleGroupRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(DispatchRuleGroupRuleArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.groupRules = mapped
    }

    /**
     * @param values Sets the event group. See `group_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("kwpxnubjgptpmxhe")
    public suspend fun groupRules(vararg values: DispatchRuleGroupRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.groupRules = mapped
    }

    /**
     * @param value Specifies whether to send the restored alert. Valid values: true: sends the alert. false: does not send the alert.
     */
    @JvmName("uypctawpgjwdtbsw")
    public suspend fun isRecover(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.isRecover = mapped
    }

    /**
     * @param value Sets the dispatch rule. See `label_match_expression_grid` below.
     */
    @JvmName("ohsqpuxinqeyidhs")
    public suspend fun labelMatchExpressionGrids(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labelMatchExpressionGrids = mapped
    }

    /**
     * @param argument Sets the dispatch rule. See `label_match_expression_grid` below.
     */
    @JvmName("axrhirixnxqbwtop")
    public suspend fun labelMatchExpressionGrids(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DispatchRuleLabelMatchExpressionGridArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.labelMatchExpressionGrids = mapped
    }

    /**
     * @param argument Sets the dispatch rule. See `label_match_expression_grid` below.
     */
    @JvmName("xcjrrxspuuvcyjhn")
    public suspend fun labelMatchExpressionGrids(vararg argument: suspend DispatchRuleLabelMatchExpressionGridArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            DispatchRuleLabelMatchExpressionGridArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.labelMatchExpressionGrids = mapped
    }

    /**
     * @param argument Sets the dispatch rule. See `label_match_expression_grid` below.
     */
    @JvmName("hydpmurtpfebkieh")
    public suspend fun labelMatchExpressionGrids(argument: suspend DispatchRuleLabelMatchExpressionGridArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            DispatchRuleLabelMatchExpressionGridArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.labelMatchExpressionGrids = mapped
    }

    /**
     * @param values Sets the dispatch rule. See `label_match_expression_grid` below.
     */
    @JvmName("bjnommpwllgmdbyj")
    public suspend fun labelMatchExpressionGrids(vararg values: DispatchRuleLabelMatchExpressionGridArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labelMatchExpressionGrids = mapped
    }

    /**
     * @param value Sets the notification rule. See `notify_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("delnqusvydogyvto")
    public suspend fun notifyRules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.notifyRules = mapped
    }

    /**
     * @param argument Sets the notification rule. See `notify_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("rtilxasbvtwyvvxf")
    public suspend fun notifyRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DispatchRuleNotifyRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.notifyRules = mapped
    }

    /**
     * @param argument Sets the notification rule. See `notify_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("afapyoxulkomntwa")
    public suspend fun notifyRules(vararg argument: suspend DispatchRuleNotifyRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            DispatchRuleNotifyRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.notifyRules = mapped
    }

    /**
     * @param argument Sets the notification rule. See `notify_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("lutywcqbdmpyjtmp")
    public suspend fun notifyRules(argument: suspend DispatchRuleNotifyRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(DispatchRuleNotifyRuleArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.notifyRules = mapped
    }

    /**
     * @param values Sets the notification rule. See `notify_rules` below. It will be ignored  when `dispatch_type = "DISCARD_ALERT"`.
     */
    @JvmName("krogpwmjlkokvwsu")
    public suspend fun notifyRules(vararg values: DispatchRuleNotifyRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.notifyRules = mapped
    }

    internal fun build(): DispatchRuleArgs = DispatchRuleArgs(
        dispatchRuleName = dispatchRuleName,
        dispatchType = dispatchType,
        groupRules = groupRules,
        isRecover = isRecover,
        labelMatchExpressionGrids = labelMatchExpressionGrids,
        notifyRules = notifyRules,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy