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

com.pulumi.kubernetes.resource.v1alpha2.kotlin.outputs.StructuredResourceHandle.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.outputs

import com.google.gson.GsonBuilder
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonElement
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List

/**
 * 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 StructuredResourceHandle(
    public val nodeName: String? = null,
    public val results: List,
    public val vendorClaimParameters: JsonElement? = null,
    public val vendorClassParameters: JsonElement? = null,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.kubernetes.resource.v1alpha2.outputs.StructuredResourceHandle): StructuredResourceHandle = StructuredResourceHandle(
            nodeName = javaType.nodeName().map({ args0 -> args0 }).orElse(null),
            results = javaType.results().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.kubernetes.resource.v1alpha2.kotlin.outputs.DriverAllocationResult.Companion.toKotlin(args0)
                })
            }),
            vendorClaimParameters = javaType.vendorClaimParameters().map({ args0 ->
                Json.parseToJsonElement(GsonBuilder().serializeNulls().create().toJson(args0))
            }).orElse(null),
            vendorClassParameters = javaType.vendorClassParameters().map({ args0 ->
                Json.parseToJsonElement(GsonBuilder().serializeNulls().create().toJson(args0))
            }).orElse(null),
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy