com.pulumi.kubernetes.apiextensions.v1.kotlin.inputs.CustomResourceConversionArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-kubernetes-kotlin Show documentation
Show all versions of pulumi-kubernetes-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.kubernetes.apiextensions.v1.kotlin.inputs
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 com.pulumi.kubernetes.apiextensions.v1.inputs.CustomResourceConversionArgs.builder
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* CustomResourceConversion describes how to convert different versions of a CR.
* @property strategy strategy specifies how custom resources are converted between versions. Allowed values are: - `"None"`: The converter only change the apiVersion and would not touch any other field in the custom resource. - `"Webhook"`: API Server will call to an external webhook to do the conversion. Additional information
* is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhook to be set.
* @property webhook webhook describes how to call the conversion webhook. Required when `strategy` is set to `"Webhook"`.
*/
public data class CustomResourceConversionArgs(
public val strategy: Output,
public val webhook: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.kubernetes.apiextensions.v1.inputs.CustomResourceConversionArgs = com.pulumi.kubernetes.apiextensions.v1.inputs.CustomResourceConversionArgs.builder()
.strategy(strategy.applyValue({ args0 -> args0 }))
.webhook(webhook?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}
/**
* Builder for [CustomResourceConversionArgs].
*/
@PulumiTagMarker
public class CustomResourceConversionArgsBuilder internal constructor() {
private var strategy: Output? = null
private var webhook: Output? = null
/**
* @param value strategy specifies how custom resources are converted between versions. Allowed values are: - `"None"`: The converter only change the apiVersion and would not touch any other field in the custom resource. - `"Webhook"`: API Server will call to an external webhook to do the conversion. Additional information
* is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhook to be set.
*/
@JvmName("koqiwyywvufsuyxy")
public suspend fun strategy(`value`: Output) {
this.strategy = value
}
/**
* @param value webhook describes how to call the conversion webhook. Required when `strategy` is set to `"Webhook"`.
*/
@JvmName("mlodcigvrehksdbs")
public suspend fun webhook(`value`: Output) {
this.webhook = value
}
/**
* @param value strategy specifies how custom resources are converted between versions. Allowed values are: - `"None"`: The converter only change the apiVersion and would not touch any other field in the custom resource. - `"Webhook"`: API Server will call to an external webhook to do the conversion. Additional information
* is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhook to be set.
*/
@JvmName("mjdrviujtcclutrv")
public suspend fun strategy(`value`: String) {
val toBeMapped = value
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.strategy = mapped
}
/**
* @param value webhook describes how to call the conversion webhook. Required when `strategy` is set to `"Webhook"`.
*/
@JvmName("gjccwdtlvkflfxqb")
public suspend fun webhook(`value`: WebhookConversionArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.webhook = mapped
}
/**
* @param argument webhook describes how to call the conversion webhook. Required when `strategy` is set to `"Webhook"`.
*/
@JvmName("gnvmvcojpfkmysei")
public suspend fun webhook(argument: suspend WebhookConversionArgsBuilder.() -> Unit) {
val toBeMapped = WebhookConversionArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.webhook = mapped
}
internal fun build(): CustomResourceConversionArgs = CustomResourceConversionArgs(
strategy = strategy ?: throw PulumiNullFieldException("strategy"),
webhook = webhook,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy