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

com.pulumi.kubernetes.resource.v1alpha2.kotlin.inputs.StructuredResourceHandleArgs.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.resource.v1alpha2.kotlin.inputs

import com.google.gson.JsonParser
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.resource.v1alpha2.inputs.StructuredResourceHandleArgs.builder
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonElement
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * StructuredResourceHandle is the in-tree representation of the allocation result.
 * @property nodeName NodeName is the name of the node providing the necessary resources if the resources are local to a node.
 * @property results Results lists all allocated driver resources.
 * @property vendorClaimParameters VendorClaimParameters are the per-claim configuration parameters from the resource claim parameters at the time that the claim was allocated.
 * @property vendorClassParameters VendorClassParameters are the per-claim configuration parameters from the resource class at the time that the claim was allocated.
 */
public data class StructuredResourceHandleArgs(
    public val nodeName: Output? = null,
    public val results: Output>,
    public val vendorClaimParameters: Output? = null,
    public val vendorClassParameters: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.resource.v1alpha2.inputs.StructuredResourceHandleArgs = com.pulumi.kubernetes.resource.v1alpha2.inputs.StructuredResourceHandleArgs.builder()
        .nodeName(nodeName?.applyValue({ args0 -> args0 }))
        .results(
            results.applyValue({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                })
            }),
        )
        .vendorClaimParameters(
            vendorClaimParameters?.applyValue({ args0 ->
                JsonParser.parseString(Json.encodeToString(JsonElement.serializer(), args0))
            }),
        )
        .vendorClassParameters(
            vendorClassParameters?.applyValue({ args0 ->
                JsonParser.parseString(Json.encodeToString(JsonElement.serializer(), args0))
            }),
        ).build()
}

/**
 * Builder for [StructuredResourceHandleArgs].
 */
@PulumiTagMarker
public class StructuredResourceHandleArgsBuilder internal constructor() {
    private var nodeName: Output? = null

    private var results: Output>? = null

    private var vendorClaimParameters: Output? = null

    private var vendorClassParameters: Output? = null

    /**
     * @param value NodeName is the name of the node providing the necessary resources if the resources are local to a node.
     */
    @JvmName("rwbebqlpcyecpmii")
    public suspend fun nodeName(`value`: Output) {
        this.nodeName = value
    }

    /**
     * @param value Results lists all allocated driver resources.
     */
    @JvmName("rymckwwdrjlvvklh")
    public suspend fun results(`value`: Output>) {
        this.results = value
    }

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

    /**
     * @param values Results lists all allocated driver resources.
     */
    @JvmName("gdqwmkfhskohcevx")
    public suspend fun results(values: List>) {
        this.results = Output.all(values)
    }

    /**
     * @param value VendorClaimParameters are the per-claim configuration parameters from the resource claim parameters at the time that the claim was allocated.
     */
    @JvmName("fntxlmdkpwsfgsur")
    public suspend fun vendorClaimParameters(`value`: Output) {
        this.vendorClaimParameters = value
    }

    /**
     * @param value VendorClassParameters are the per-claim configuration parameters from the resource class at the time that the claim was allocated.
     */
    @JvmName("bwejnjtqgsadnxag")
    public suspend fun vendorClassParameters(`value`: Output) {
        this.vendorClassParameters = value
    }

    /**
     * @param value NodeName is the name of the node providing the necessary resources if the resources are local to a node.
     */
    @JvmName("kgyuwymsmtkoxynh")
    public suspend fun nodeName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.nodeName = mapped
    }

    /**
     * @param value Results lists all allocated driver resources.
     */
    @JvmName("koyyytorworsspbx")
    public suspend fun results(`value`: List) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.results = mapped
    }

    /**
     * @param argument Results lists all allocated driver resources.
     */
    @JvmName("jjcbvmdtqxsslnfs")
    public suspend fun results(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DriverAllocationResultArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.results = mapped
    }

    /**
     * @param argument Results lists all allocated driver resources.
     */
    @JvmName("fqssjcpesnnftlpm")
    public suspend fun results(vararg argument: suspend DriverAllocationResultArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            DriverAllocationResultArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.results = mapped
    }

    /**
     * @param argument Results lists all allocated driver resources.
     */
    @JvmName("mcwauclusikegufi")
    public suspend fun results(argument: suspend DriverAllocationResultArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(DriverAllocationResultArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.results = mapped
    }

    /**
     * @param values Results lists all allocated driver resources.
     */
    @JvmName("klgulbdkrnuqjdsv")
    public suspend fun results(vararg values: DriverAllocationResultArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.results = mapped
    }

    /**
     * @param value VendorClaimParameters are the per-claim configuration parameters from the resource claim parameters at the time that the claim was allocated.
     */
    @JvmName("oksinckfchqfyhbh")
    public suspend fun vendorClaimParameters(`value`: JsonElement?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vendorClaimParameters = mapped
    }

    /**
     * @param value VendorClassParameters are the per-claim configuration parameters from the resource class at the time that the claim was allocated.
     */
    @JvmName("vbyphidirngiuiuk")
    public suspend fun vendorClassParameters(`value`: JsonElement?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vendorClassParameters = mapped
    }

    internal fun build(): StructuredResourceHandleArgs = StructuredResourceHandleArgs(
        nodeName = nodeName,
        results = results ?: throw PulumiNullFieldException("results"),
        vendorClaimParameters = vendorClaimParameters,
        vendorClassParameters = vendorClassParameters,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy