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

com.pulumi.kubernetes.resource.v1alpha2.kotlin.inputs.AllocationResultArgs.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.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.core.v1.kotlin.inputs.NodeSelectorArgs
import com.pulumi.kubernetes.core.v1.kotlin.inputs.NodeSelectorArgsBuilder
import com.pulumi.kubernetes.resource.v1alpha2.inputs.AllocationResultArgs.builder
import kotlin.Boolean
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * AllocationResult contains attributes of an allocated resource.
 * @property availableOnNodes This field will get set by the resource driver after it has allocated the resource to inform the scheduler where it can schedule Pods using the ResourceClaim.
 * Setting this field is optional. If null, the resource is available everywhere.
 * @property resourceHandles ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.
 * Setting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.
 * @property shareable Shareable determines whether the resource supports more than one consumer at a time.
 */
public data class AllocationResultArgs(
    public val availableOnNodes: Output? = null,
    public val resourceHandles: Output>? = null,
    public val shareable: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.kubernetes.resource.v1alpha2.inputs.AllocationResultArgs =
        com.pulumi.kubernetes.resource.v1alpha2.inputs.AllocationResultArgs.builder()
            .availableOnNodes(availableOnNodes?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .resourceHandles(
                resourceHandles?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .shareable(shareable?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AllocationResultArgs].
 */
@PulumiTagMarker
public class AllocationResultArgsBuilder internal constructor() {
    private var availableOnNodes: Output? = null

    private var resourceHandles: Output>? = null

    private var shareable: Output? = null

    /**
     * @param value This field will get set by the resource driver after it has allocated the resource to inform the scheduler where it can schedule Pods using the ResourceClaim.
     * Setting this field is optional. If null, the resource is available everywhere.
     */
    @JvmName("tnolmrhgigneejom")
    public suspend fun availableOnNodes(`value`: Output) {
        this.availableOnNodes = value
    }

    /**
     * @param value ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.
     * Setting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.
     */
    @JvmName("uxrfkmembmltebsn")
    public suspend fun resourceHandles(`value`: Output>) {
        this.resourceHandles = value
    }

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

    /**
     * @param values ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.
     * Setting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.
     */
    @JvmName("rusblmnxuoxhuqwu")
    public suspend fun resourceHandles(values: List>) {
        this.resourceHandles = Output.all(values)
    }

    /**
     * @param value Shareable determines whether the resource supports more than one consumer at a time.
     */
    @JvmName("vvqoagyxnpdebfug")
    public suspend fun shareable(`value`: Output) {
        this.shareable = value
    }

    /**
     * @param value This field will get set by the resource driver after it has allocated the resource to inform the scheduler where it can schedule Pods using the ResourceClaim.
     * Setting this field is optional. If null, the resource is available everywhere.
     */
    @JvmName("hsaunpltiibleagk")
    public suspend fun availableOnNodes(`value`: NodeSelectorArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.availableOnNodes = mapped
    }

    /**
     * @param argument This field will get set by the resource driver after it has allocated the resource to inform the scheduler where it can schedule Pods using the ResourceClaim.
     * Setting this field is optional. If null, the resource is available everywhere.
     */
    @JvmName("ewnclcjdrgymikyd")
    public suspend fun availableOnNodes(argument: suspend NodeSelectorArgsBuilder.() -> Unit) {
        val toBeMapped = NodeSelectorArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.availableOnNodes = mapped
    }

    /**
     * @param value ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.
     * Setting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.
     */
    @JvmName("uwimwfajbfcfbxli")
    public suspend fun resourceHandles(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceHandles = mapped
    }

    /**
     * @param argument ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.
     * Setting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.
     */
    @JvmName("nkvnitnirpdxcyey")
    public suspend fun resourceHandles(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ResourceHandleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.resourceHandles = mapped
    }

    /**
     * @param argument ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.
     * Setting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.
     */
    @JvmName("olsglghwhkoymlml")
    public suspend fun resourceHandles(vararg argument: suspend ResourceHandleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ResourceHandleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.resourceHandles = mapped
    }

    /**
     * @param argument ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.
     * Setting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.
     */
    @JvmName("wshvdcgkbiwwnjkd")
    public suspend fun resourceHandles(argument: suspend ResourceHandleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ResourceHandleArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.resourceHandles = mapped
    }

    /**
     * @param values ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.
     * Setting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.
     */
    @JvmName("wqkpmnyffpbmwftl")
    public suspend fun resourceHandles(vararg values: ResourceHandleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.resourceHandles = mapped
    }

    /**
     * @param value Shareable determines whether the resource supports more than one consumer at a time.
     */
    @JvmName("lxdfjugntavwhene")
    public suspend fun shareable(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.shareable = mapped
    }

    internal fun build(): AllocationResultArgs = AllocationResultArgs(
        availableOnNodes = availableOnNodes,
        resourceHandles = resourceHandles,
        shareable = shareable,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy