com.pulumi.azurenative.monitor.kotlin.inputs.ReceiverArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.monitor.kotlin.inputs
import com.pulumi.azurenative.monitor.inputs.ReceiverArgs.builder
import com.pulumi.azurenative.monitor.kotlin.enums.ReceiverType
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.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* Receiver Info.
* @property name The name of receiver.
* @property otlp OTLP receiver configurations. This field is mandatory for OTLP and pipelineGroup receivers.
* @property syslog Syslog configurations. This field is mandatory for syslog type receivers.
* @property type The type of receiver.
* @property udp UDP receiver configurations. This field is mandatory for UDP receivers.
*/
public data class ReceiverArgs(
public val name: Output,
public val otlp: Output? = null,
public val syslog: Output? = null,
public val type: Output>,
public val udp: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.monitor.inputs.ReceiverArgs =
com.pulumi.azurenative.monitor.inputs.ReceiverArgs.builder()
.name(name.applyValue({ args0 -> args0 }))
.otlp(otlp?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.syslog(syslog?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.type(
type.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.udp(udp?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}
/**
* Builder for [ReceiverArgs].
*/
@PulumiTagMarker
public class ReceiverArgsBuilder internal constructor() {
private var name: Output? = null
private var otlp: Output? = null
private var syslog: Output? = null
private var type: Output>? = null
private var udp: Output? = null
/**
* @param value The name of receiver.
*/
@JvmName("kmlksixgorqpmnwb")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value OTLP receiver configurations. This field is mandatory for OTLP and pipelineGroup receivers.
*/
@JvmName("fblujxyrqjjcvxxh")
public suspend fun otlp(`value`: Output) {
this.otlp = value
}
/**
* @param value Syslog configurations. This field is mandatory for syslog type receivers.
*/
@JvmName("qvmljaffmtilkkyr")
public suspend fun syslog(`value`: Output) {
this.syslog = value
}
/**
* @param value The type of receiver.
*/
@JvmName("tejqsebytvoxpprk")
public suspend fun type(`value`: Output>) {
this.type = value
}
/**
* @param value UDP receiver configurations. This field is mandatory for UDP receivers.
*/
@JvmName("dfqhfgtiqnagashy")
public suspend fun udp(`value`: Output) {
this.udp = value
}
/**
* @param value The name of receiver.
*/
@JvmName("dmmeeylljgsuywkl")
public suspend fun name(`value`: String) {
val toBeMapped = value
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value OTLP receiver configurations. This field is mandatory for OTLP and pipelineGroup receivers.
*/
@JvmName("lxaqlkrtsrkyqjhq")
public suspend fun otlp(`value`: OtlpReceiverArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.otlp = mapped
}
/**
* @param argument OTLP receiver configurations. This field is mandatory for OTLP and pipelineGroup receivers.
*/
@JvmName("lcjcyadweguihiaa")
public suspend fun otlp(argument: suspend OtlpReceiverArgsBuilder.() -> Unit) {
val toBeMapped = OtlpReceiverArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.otlp = mapped
}
/**
* @param value Syslog configurations. This field is mandatory for syslog type receivers.
*/
@JvmName("ixsroqnlymehaast")
public suspend fun syslog(`value`: SyslogReceiverArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.syslog = mapped
}
/**
* @param argument Syslog configurations. This field is mandatory for syslog type receivers.
*/
@JvmName("lgkxjihursyetmbu")
public suspend fun syslog(argument: suspend SyslogReceiverArgsBuilder.() -> Unit) {
val toBeMapped = SyslogReceiverArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.syslog = mapped
}
/**
* @param value The type of receiver.
*/
@JvmName("rkxoswbokiulbpmq")
public suspend fun type(`value`: Either) {
val toBeMapped = value
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.type = mapped
}
/**
* @param value The type of receiver.
*/
@JvmName("qmgmabncxkfpckhb")
public fun type(`value`: String) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.type = mapped
}
/**
* @param value The type of receiver.
*/
@JvmName("hjdqpfufcrlkgwsd")
public fun type(`value`: ReceiverType) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.type = mapped
}
/**
* @param value UDP receiver configurations. This field is mandatory for UDP receivers.
*/
@JvmName("dekjcmyuunywqbuu")
public suspend fun udp(`value`: UdpReceiverArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.udp = mapped
}
/**
* @param argument UDP receiver configurations. This field is mandatory for UDP receivers.
*/
@JvmName("nejxgdirebknqqiq")
public suspend fun udp(argument: suspend UdpReceiverArgsBuilder.() -> Unit) {
val toBeMapped = UdpReceiverArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.udp = mapped
}
internal fun build(): ReceiverArgs = ReceiverArgs(
name = name ?: throw PulumiNullFieldException("name"),
otlp = otlp,
syslog = syslog,
type = type ?: throw PulumiNullFieldException("type"),
udp = udp,
)
}