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

com.pulumi.gcp.monitoring.kotlin.inputs.AlertPolicyConditionConditionMatchedLogArgs.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: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.monitoring.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.monitoring.inputs.AlertPolicyConditionConditionMatchedLogArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 *
 * @property filter A logs-based filter.
 * @property labelExtractors A map from a label key to an extractor expression, which is used to
 * extract the value for this label key. Each entry in this map is
 * a specification for how data should be extracted from log entries that
 * match filter. Each combination of extracted values is treated as
 * a separate rule for the purposes of triggering notifications.
 * Label keys and corresponding values can be used in notifications
 * generated by this condition.
 */
public data class AlertPolicyConditionConditionMatchedLogArgs(
    public val filter: Output,
    public val labelExtractors: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.monitoring.inputs.AlertPolicyConditionConditionMatchedLogArgs =
        com.pulumi.gcp.monitoring.inputs.AlertPolicyConditionConditionMatchedLogArgs.builder()
            .filter(filter.applyValue({ args0 -> args0 }))
            .labelExtractors(
                labelExtractors?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [AlertPolicyConditionConditionMatchedLogArgs].
 */
@PulumiTagMarker
public class AlertPolicyConditionConditionMatchedLogArgsBuilder internal constructor() {
    private var filter: Output? = null

    private var labelExtractors: Output>? = null

    /**
     * @param value A logs-based filter.
     */
    @JvmName("jwclcmxllelqvmpf")
    public suspend fun filter(`value`: Output) {
        this.filter = value
    }

    /**
     * @param value A map from a label key to an extractor expression, which is used to
     * extract the value for this label key. Each entry in this map is
     * a specification for how data should be extracted from log entries that
     * match filter. Each combination of extracted values is treated as
     * a separate rule for the purposes of triggering notifications.
     * Label keys and corresponding values can be used in notifications
     * generated by this condition.
     */
    @JvmName("ddfvrkmblqbqvpmv")
    public suspend fun labelExtractors(`value`: Output>) {
        this.labelExtractors = value
    }

    /**
     * @param value A logs-based filter.
     */
    @JvmName("jnivcfqsftxxcvab")
    public suspend fun filter(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.filter = mapped
    }

    /**
     * @param value A map from a label key to an extractor expression, which is used to
     * extract the value for this label key. Each entry in this map is
     * a specification for how data should be extracted from log entries that
     * match filter. Each combination of extracted values is treated as
     * a separate rule for the purposes of triggering notifications.
     * Label keys and corresponding values can be used in notifications
     * generated by this condition.
     */
    @JvmName("ovbujljrkmmhkubg")
    public suspend fun labelExtractors(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labelExtractors = mapped
    }

    /**
     * @param values A map from a label key to an extractor expression, which is used to
     * extract the value for this label key. Each entry in this map is
     * a specification for how data should be extracted from log entries that
     * match filter. Each combination of extracted values is treated as
     * a separate rule for the purposes of triggering notifications.
     * Label keys and corresponding values can be used in notifications
     * generated by this condition.
     */
    @JvmName("hhnlkasxsvvlmaqo")
    public fun labelExtractors(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labelExtractors = mapped
    }

    internal fun build(): AlertPolicyConditionConditionMatchedLogArgs =
        AlertPolicyConditionConditionMatchedLogArgs(
            filter = filter ?: throw PulumiNullFieldException("filter"),
            labelExtractors = labelExtractors,
        )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy