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

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

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.monitoring.kotlin

import com.pulumi.azure.monitoring.DataCollectionRuleArgs.builder
import com.pulumi.azure.monitoring.kotlin.inputs.DataCollectionRuleDataFlowArgs
import com.pulumi.azure.monitoring.kotlin.inputs.DataCollectionRuleDataFlowArgsBuilder
import com.pulumi.azure.monitoring.kotlin.inputs.DataCollectionRuleDataSourcesArgs
import com.pulumi.azure.monitoring.kotlin.inputs.DataCollectionRuleDataSourcesArgsBuilder
import com.pulumi.azure.monitoring.kotlin.inputs.DataCollectionRuleDestinationsArgs
import com.pulumi.azure.monitoring.kotlin.inputs.DataCollectionRuleDestinationsArgsBuilder
import com.pulumi.azure.monitoring.kotlin.inputs.DataCollectionRuleIdentityArgs
import com.pulumi.azure.monitoring.kotlin.inputs.DataCollectionRuleIdentityArgsBuilder
import com.pulumi.azure.monitoring.kotlin.inputs.DataCollectionRuleStreamDeclarationArgs
import com.pulumi.azure.monitoring.kotlin.inputs.DataCollectionRuleStreamDeclarationArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a Data Collection Rule.
 * ## Import
 * Data Collection Rules can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:monitoring/dataCollectionRule:DataCollectionRule example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Insights/dataCollectionRules/rule1
 * ```
 * @property dataCollectionEndpointId The resource ID of the Data Collection Endpoint that this rule can be used with.
 * @property dataFlows One or more `data_flow` blocks as defined below.
 * @property dataSources A `data_sources` block as defined below. This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint.
 * @property description The description of the Data Collection Rule.
 * @property destinations A `destinations` block as defined below.
 * @property identity An `identity` block as defined below.
 * @property kind The kind of the Data Collection Rule. Possible values are `Linux`, `Windows`, `AgentDirectToStore` and `WorkspaceTransforms`. A rule of kind `Linux` does not allow for `windows_event_log` data sources. And a rule of kind `Windows` does not allow for `syslog` data sources. If kind is not specified, all kinds of data sources are allowed.
 * > **NOTE** Once `kind` has been set, changing it forces a new Data Collection Rule to be created.
 * @property location The Azure Region where the Data Collection Rule should exist. Changing this forces a new Data Collection Rule to be created.
 * @property name The name which should be used for this Data Collection Rule. Changing this forces a new Data Collection Rule to be created.
 * @property resourceGroupName The name of the Resource Group where the Data Collection Rule should exist. Changing this forces a new Data Collection Rule to be created.
 * @property streamDeclarations A `stream_declaration` block as defined below.
 * @property tags A mapping of tags which should be assigned to the Data Collection Rule.
 */
public data class DataCollectionRuleArgs(
    public val dataCollectionEndpointId: Output? = null,
    public val dataFlows: Output>? = null,
    public val dataSources: Output? = null,
    public val description: Output? = null,
    public val destinations: Output? = null,
    public val identity: Output? = null,
    public val kind: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val streamDeclarations: Output>? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.monitoring.DataCollectionRuleArgs =
        com.pulumi.azure.monitoring.DataCollectionRuleArgs.builder()
            .dataCollectionEndpointId(dataCollectionEndpointId?.applyValue({ args0 -> args0 }))
            .dataFlows(
                dataFlows?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .dataSources(dataSources?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .description(description?.applyValue({ args0 -> args0 }))
            .destinations(destinations?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .kind(kind?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .streamDeclarations(
                streamDeclarations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [DataCollectionRuleArgs].
 */
@PulumiTagMarker
public class DataCollectionRuleArgsBuilder internal constructor() {
    private var dataCollectionEndpointId: Output? = null

    private var dataFlows: Output>? = null

    private var dataSources: Output? = null

    private var description: Output? = null

    private var destinations: Output? = null

    private var identity: Output? = null

    private var kind: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var streamDeclarations: Output>? = null

    private var tags: Output>? = null

    /**
     * @param value The resource ID of the Data Collection Endpoint that this rule can be used with.
     */
    @JvmName("xdarkdhqiymoqsgg")
    public suspend fun dataCollectionEndpointId(`value`: Output) {
        this.dataCollectionEndpointId = value
    }

    /**
     * @param value One or more `data_flow` blocks as defined below.
     */
    @JvmName("cnrjokfwejmanbro")
    public suspend fun dataFlows(`value`: Output>) {
        this.dataFlows = value
    }

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

    /**
     * @param values One or more `data_flow` blocks as defined below.
     */
    @JvmName("rbmoqfrxrbpgabpo")
    public suspend fun dataFlows(values: List>) {
        this.dataFlows = Output.all(values)
    }

    /**
     * @param value A `data_sources` block as defined below. This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint.
     */
    @JvmName("chheflnyusynvxio")
    public suspend fun dataSources(`value`: Output) {
        this.dataSources = value
    }

    /**
     * @param value The description of the Data Collection Rule.
     */
    @JvmName("gluxqicndykkkrkp")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

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

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

    /**
     * @param value The kind of the Data Collection Rule. Possible values are `Linux`, `Windows`, `AgentDirectToStore` and `WorkspaceTransforms`. A rule of kind `Linux` does not allow for `windows_event_log` data sources. And a rule of kind `Windows` does not allow for `syslog` data sources. If kind is not specified, all kinds of data sources are allowed.
     * > **NOTE** Once `kind` has been set, changing it forces a new Data Collection Rule to be created.
     */
    @JvmName("kmdwfqbnfgotxckw")
    public suspend fun kind(`value`: Output) {
        this.kind = value
    }

    /**
     * @param value The Azure Region where the Data Collection Rule should exist. Changing this forces a new Data Collection Rule to be created.
     */
    @JvmName("xujpderddbntfivy")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The name which should be used for this Data Collection Rule. Changing this forces a new Data Collection Rule to be created.
     */
    @JvmName("axrqlpwdmhqhcldc")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the Resource Group where the Data Collection Rule should exist. Changing this forces a new Data Collection Rule to be created.
     */
    @JvmName("ncfetxetxsdgmogt")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

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

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

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

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

    /**
     * @param value The resource ID of the Data Collection Endpoint that this rule can be used with.
     */
    @JvmName("vjcljhiqhsbggpkr")
    public suspend fun dataCollectionEndpointId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dataCollectionEndpointId = mapped
    }

    /**
     * @param value One or more `data_flow` blocks as defined below.
     */
    @JvmName("uaiwvwqyrwbauvoe")
    public suspend fun dataFlows(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dataFlows = mapped
    }

    /**
     * @param argument One or more `data_flow` blocks as defined below.
     */
    @JvmName("xsjibasvutprtseb")
    public suspend fun dataFlows(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DataCollectionRuleDataFlowArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.dataFlows = mapped
    }

    /**
     * @param argument One or more `data_flow` blocks as defined below.
     */
    @JvmName("fixklnrsvfqcbafh")
    public suspend fun dataFlows(vararg argument: suspend DataCollectionRuleDataFlowArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            DataCollectionRuleDataFlowArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.dataFlows = mapped
    }

    /**
     * @param argument One or more `data_flow` blocks as defined below.
     */
    @JvmName("tfadmfpvkrsucdkr")
    public suspend fun dataFlows(argument: suspend DataCollectionRuleDataFlowArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            DataCollectionRuleDataFlowArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.dataFlows = mapped
    }

    /**
     * @param values One or more `data_flow` blocks as defined below.
     */
    @JvmName("chiqipbcxlgxsecg")
    public suspend fun dataFlows(vararg values: DataCollectionRuleDataFlowArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.dataFlows = mapped
    }

    /**
     * @param value A `data_sources` block as defined below. This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint.
     */
    @JvmName("wgxowlspuoalwyex")
    public suspend fun dataSources(`value`: DataCollectionRuleDataSourcesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dataSources = mapped
    }

    /**
     * @param argument A `data_sources` block as defined below. This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint.
     */
    @JvmName("ecytqxpngrljnpmd")
    public suspend fun dataSources(argument: suspend DataCollectionRuleDataSourcesArgsBuilder.() -> Unit) {
        val toBeMapped = DataCollectionRuleDataSourcesArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.dataSources = mapped
    }

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

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

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

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

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

    /**
     * @param value The kind of the Data Collection Rule. Possible values are `Linux`, `Windows`, `AgentDirectToStore` and `WorkspaceTransforms`. A rule of kind `Linux` does not allow for `windows_event_log` data sources. And a rule of kind `Windows` does not allow for `syslog` data sources. If kind is not specified, all kinds of data sources are allowed.
     * > **NOTE** Once `kind` has been set, changing it forces a new Data Collection Rule to be created.
     */
    @JvmName("jienqdehuwcxbpct")
    public suspend fun kind(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.kind = mapped
    }

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

    /**
     * @param value The name which should be used for this Data Collection Rule. Changing this forces a new Data Collection Rule to be created.
     */
    @JvmName("avtuexvfwpfguqwp")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

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

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

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

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

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

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

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

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

    internal fun build(): DataCollectionRuleArgs = DataCollectionRuleArgs(
        dataCollectionEndpointId = dataCollectionEndpointId,
        dataFlows = dataFlows,
        dataSources = dataSources,
        description = description,
        destinations = destinations,
        identity = identity,
        kind = kind,
        location = location,
        name = name,
        resourceGroupName = resourceGroupName,
        streamDeclarations = streamDeclarations,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy