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

com.pulumi.kubernetes.apiextensions.v1.kotlin.inputs.CustomResourceConversionPatchArgs.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: 4.18.2.0
Show newest version
@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.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import com.pulumi.kubernetes.apiextensions.v1.inputs.CustomResourceConversionPatchArgs.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 CustomResourceConversionPatchArgs(
    public val strategy: Output? = null,
    public val webhook: Output? = null,
) :
    ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.apiextensions.v1.inputs.CustomResourceConversionPatchArgs =
        com.pulumi.kubernetes.apiextensions.v1.inputs.CustomResourceConversionPatchArgs.builder()
            .strategy(strategy?.applyValue({ args0 -> args0 }))
            .webhook(webhook?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [CustomResourceConversionPatchArgs].
 */
@PulumiTagMarker
public class CustomResourceConversionPatchArgsBuilder 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("difekdpjkkpvjelr")
    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("jvmktuajkfrsigqc")
    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("umdddlsrowcgytwg")
    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("aifpkyetbvomdeod")
    public suspend fun webhook(`value`: WebhookConversionPatchArgs?) {
        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("ijelaqpnhddytqry")
    public suspend fun webhook(argument: suspend WebhookConversionPatchArgsBuilder.() -> Unit) {
        val toBeMapped = WebhookConversionPatchArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.webhook = mapped
    }

    internal fun build(): CustomResourceConversionPatchArgs = CustomResourceConversionPatchArgs(
        strategy = strategy,
        webhook = webhook,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy