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

com.pulumi.azurenative.compute.kotlin.inputs.ImageOSDiskArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.compute.kotlin.inputs

import com.pulumi.azurenative.compute.inputs.ImageOSDiskArgs.builder
import com.pulumi.azurenative.compute.kotlin.enums.CachingTypes
import com.pulumi.azurenative.compute.kotlin.enums.OperatingSystemStateTypes
import com.pulumi.azurenative.compute.kotlin.enums.OperatingSystemTypes
import com.pulumi.azurenative.compute.kotlin.enums.StorageAccountTypes
import com.pulumi.core.Either
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 kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * Describes an Operating System disk.
 * @property blobUri The Virtual Hard Disk.
 * @property caching Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.**
 * @property diskEncryptionSet Specifies the customer managed disk encryption set resource id for the managed image disk.
 * @property diskSizeGB Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. This value cannot be larger than 1023 GB.
 * @property managedDisk The managedDisk.
 * @property osState The OS State. For managed images, use Generalized.
 * @property osType This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image. Possible values are: **Windows,** **Linux.**
 * @property snapshot The snapshot.
 * @property storageAccountType Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk.
 */
public data class ImageOSDiskArgs(
    public val blobUri: Output? = null,
    public val caching: Output? = null,
    public val diskEncryptionSet: Output? = null,
    public val diskSizeGB: Output? = null,
    public val managedDisk: Output? = null,
    public val osState: Output,
    public val osType: Output,
    public val snapshot: Output? = null,
    public val storageAccountType: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.compute.inputs.ImageOSDiskArgs =
        com.pulumi.azurenative.compute.inputs.ImageOSDiskArgs.builder()
            .blobUri(blobUri?.applyValue({ args0 -> args0 }))
            .caching(caching?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .diskEncryptionSet(diskEncryptionSet?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .diskSizeGB(diskSizeGB?.applyValue({ args0 -> args0 }))
            .managedDisk(managedDisk?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .osState(osState.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .osType(osType.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .snapshot(snapshot?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .storageAccountType(
                storageAccountType?.applyValue({ args0 ->
                    args0.transform(
                        { args0 -> args0 },
                        { args0 -> args0.let({ args0 -> args0.toJava() }) },
                    )
                }),
            ).build()
}

/**
 * Builder for [ImageOSDiskArgs].
 */
@PulumiTagMarker
public class ImageOSDiskArgsBuilder internal constructor() {
    private var blobUri: Output? = null

    private var caching: Output? = null

    private var diskEncryptionSet: Output? = null

    private var diskSizeGB: Output? = null

    private var managedDisk: Output? = null

    private var osState: Output? = null

    private var osType: Output? = null

    private var snapshot: Output? = null

    private var storageAccountType: Output>? = null

    /**
     * @param value The Virtual Hard Disk.
     */
    @JvmName("dfxfnjwxsygrdkad")
    public suspend fun blobUri(`value`: Output) {
        this.blobUri = value
    }

    /**
     * @param value Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.**
     */
    @JvmName("lchyjibxepynetrn")
    public suspend fun caching(`value`: Output) {
        this.caching = value
    }

    /**
     * @param value Specifies the customer managed disk encryption set resource id for the managed image disk.
     */
    @JvmName("xcfobjayuqnogckx")
    public suspend fun diskEncryptionSet(`value`: Output) {
        this.diskEncryptionSet = value
    }

    /**
     * @param value Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. This value cannot be larger than 1023 GB.
     */
    @JvmName("vssfxmcvenyukonc")
    public suspend fun diskSizeGB(`value`: Output) {
        this.diskSizeGB = value
    }

    /**
     * @param value The managedDisk.
     */
    @JvmName("fgjacydkwpdumwxl")
    public suspend fun managedDisk(`value`: Output) {
        this.managedDisk = value
    }

    /**
     * @param value The OS State. For managed images, use Generalized.
     */
    @JvmName("ehlbirrwunhelthf")
    public suspend fun osState(`value`: Output) {
        this.osState = value
    }

    /**
     * @param value This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image. Possible values are: **Windows,** **Linux.**
     */
    @JvmName("gbpayvowmkqxjbxs")
    public suspend fun osType(`value`: Output) {
        this.osType = value
    }

    /**
     * @param value The snapshot.
     */
    @JvmName("ygnfjsneocoiktdu")
    public suspend fun snapshot(`value`: Output) {
        this.snapshot = value
    }

    /**
     * @param value Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk.
     */
    @JvmName("liyjpkbgxbohljhw")
    public suspend fun storageAccountType(`value`: Output>) {
        this.storageAccountType = value
    }

    /**
     * @param value The Virtual Hard Disk.
     */
    @JvmName("jgtaeyagbwbfdmmi")
    public suspend fun blobUri(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.blobUri = mapped
    }

    /**
     * @param value Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The default values are: **None for Standard storage. ReadOnly for Premium storage.**
     */
    @JvmName("knpmupxmjqrojimp")
    public suspend fun caching(`value`: CachingTypes?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.caching = mapped
    }

    /**
     * @param value Specifies the customer managed disk encryption set resource id for the managed image disk.
     */
    @JvmName("axttspamvflluvmy")
    public suspend fun diskEncryptionSet(`value`: DiskEncryptionSetParametersArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.diskEncryptionSet = mapped
    }

    /**
     * @param argument Specifies the customer managed disk encryption set resource id for the managed image disk.
     */
    @JvmName("nrhrdwxuudlutthp")
    public suspend fun diskEncryptionSet(argument: suspend DiskEncryptionSetParametersArgsBuilder.() -> Unit) {
        val toBeMapped = DiskEncryptionSetParametersArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.diskEncryptionSet = mapped
    }

    /**
     * @param value Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image. This value cannot be larger than 1023 GB.
     */
    @JvmName("dowwdepqeftruseo")
    public suspend fun diskSizeGB(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.diskSizeGB = mapped
    }

    /**
     * @param value The managedDisk.
     */
    @JvmName("vmhwbfsakrnxeedp")
    public suspend fun managedDisk(`value`: SubResourceArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.managedDisk = mapped
    }

    /**
     * @param argument The managedDisk.
     */
    @JvmName("rdrnygkftuoonuhp")
    public suspend fun managedDisk(argument: suspend SubResourceArgsBuilder.() -> Unit) {
        val toBeMapped = SubResourceArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.managedDisk = mapped
    }

    /**
     * @param value The OS State. For managed images, use Generalized.
     */
    @JvmName("fghluboeiddttpgy")
    public suspend fun osState(`value`: OperatingSystemStateTypes) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.osState = mapped
    }

    /**
     * @param value This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image. Possible values are: **Windows,** **Linux.**
     */
    @JvmName("bjgfcfowwcflsmsw")
    public suspend fun osType(`value`: OperatingSystemTypes) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.osType = mapped
    }

    /**
     * @param value The snapshot.
     */
    @JvmName("iorkatqxurcyxiqp")
    public suspend fun snapshot(`value`: SubResourceArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.snapshot = mapped
    }

    /**
     * @param argument The snapshot.
     */
    @JvmName("uuuliwtqyssrgoio")
    public suspend fun snapshot(argument: suspend SubResourceArgsBuilder.() -> Unit) {
        val toBeMapped = SubResourceArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.snapshot = mapped
    }

    /**
     * @param value Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk.
     */
    @JvmName("fpklnetgqgnbungi")
    public suspend fun storageAccountType(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.storageAccountType = mapped
    }

    /**
     * @param value Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk.
     */
    @JvmName("hsltwsllirejctlw")
    public fun storageAccountType(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.storageAccountType = mapped
    }

    /**
     * @param value Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk.
     */
    @JvmName("htpxjysnrpcspenb")
    public fun storageAccountType(`value`: StorageAccountTypes) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.storageAccountType = mapped
    }

    internal fun build(): ImageOSDiskArgs = ImageOSDiskArgs(
        blobUri = blobUri,
        caching = caching,
        diskEncryptionSet = diskEncryptionSet,
        diskSizeGB = diskSizeGB,
        managedDisk = managedDisk,
        osState = osState ?: throw PulumiNullFieldException("osState"),
        osType = osType ?: throw PulumiNullFieldException("osType"),
        snapshot = snapshot,
        storageAccountType = storageAccountType,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy