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

com.pulumi.azurenative.devtestlab.kotlin.DiskArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.devtestlab.kotlin

import com.pulumi.azurenative.devtestlab.DiskArgs.builder
import com.pulumi.azurenative.devtestlab.kotlin.enums.StorageType
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.PulumiTagMarker
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * A Disk.
 * Azure REST API version: 2018-09-15. Prior API version in Azure Native 1.x: 2018-09-15.
 * Other available API versions: 2016-05-15.
 * ## Example Usage
 * ### Disks_CreateOrUpdate
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var disk = new AzureNative.DevTestLab.Disk("disk", new()
 *     {
 *         DiskSizeGiB = 1023,
 *         DiskType = AzureNative.DevTestLab.StorageType.Standard,
 *         LabName = "{labName}",
 *         LeasedByLabVmId = "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName",
 *         Name = "{diskName}",
 *         ResourceGroupName = "resourceGroupName",
 *         UserName = "{userId}",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	devtestlab "github.com/pulumi/pulumi-azure-native-sdk/devtestlab/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := devtestlab.NewDisk(ctx, "disk", &devtestlab.DiskArgs{
 * 			DiskSizeGiB:       pulumi.Int(1023),
 * 			DiskType:          pulumi.String(devtestlab.StorageTypeStandard),
 * 			LabName:           pulumi.String("{labName}"),
 * 			LeasedByLabVmId:   pulumi.String("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName"),
 * 			Name:              pulumi.String("{diskName}"),
 * 			ResourceGroupName: pulumi.String("resourceGroupName"),
 * 			UserName:          pulumi.String("{userId}"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.devtestlab.Disk;
 * import com.pulumi.azurenative.devtestlab.DiskArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var disk = new Disk("disk", DiskArgs.builder()
 *             .diskSizeGiB(1023)
 *             .diskType("Standard")
 *             .labName("{labName}")
 *             .leasedByLabVmId("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualmachines/vmName")
 *             .name("{diskName}")
 *             .resourceGroupName("resourceGroupName")
 *             .userName("{userId}")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:devtestlab:Disk {diskName} /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/disks/{name}
 * ```
 * @property diskBlobName When backed by a blob, the name of the VHD blob without extension.
 * @property diskSizeGiB The size of the disk in Gibibytes.
 * @property diskType The storage type for the disk (i.e. Standard, Premium).
 * @property diskUri When backed by a blob, the URI of underlying blob.
 * @property hostCaching The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
 * @property labName The name of the lab.
 * @property leasedByLabVmId The resource ID of the VM to which this disk is leased.
 * @property location The location of the resource.
 * @property managedDiskId When backed by managed disk, this is the ID of the compute disk resource.
 * @property name The name of the disk.
 * @property resourceGroupName The name of the resource group.
 * @property storageAccountId When backed by a blob, the storage account where the blob is.
 * @property tags The tags of the resource.
 * @property userName The name of the user profile.
 */
public data class DiskArgs(
    public val diskBlobName: Output? = null,
    public val diskSizeGiB: Output? = null,
    public val diskType: Output>? = null,
    public val diskUri: Output? = null,
    public val hostCaching: Output? = null,
    public val labName: Output? = null,
    public val leasedByLabVmId: Output? = null,
    public val location: Output? = null,
    public val managedDiskId: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val storageAccountId: Output? = null,
    public val tags: Output>? = null,
    public val userName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.devtestlab.DiskArgs =
        com.pulumi.azurenative.devtestlab.DiskArgs.builder()
            .diskBlobName(diskBlobName?.applyValue({ args0 -> args0 }))
            .diskSizeGiB(diskSizeGiB?.applyValue({ args0 -> args0 }))
            .diskType(
                diskType?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .diskUri(diskUri?.applyValue({ args0 -> args0 }))
            .hostCaching(hostCaching?.applyValue({ args0 -> args0 }))
            .labName(labName?.applyValue({ args0 -> args0 }))
            .leasedByLabVmId(leasedByLabVmId?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .managedDiskId(managedDiskId?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .storageAccountId(storageAccountId?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .userName(userName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [DiskArgs].
 */
@PulumiTagMarker
public class DiskArgsBuilder internal constructor() {
    private var diskBlobName: Output? = null

    private var diskSizeGiB: Output? = null

    private var diskType: Output>? = null

    private var diskUri: Output? = null

    private var hostCaching: Output? = null

    private var labName: Output? = null

    private var leasedByLabVmId: Output? = null

    private var location: Output? = null

    private var managedDiskId: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var storageAccountId: Output? = null

    private var tags: Output>? = null

    private var userName: Output? = null

    /**
     * @param value When backed by a blob, the name of the VHD blob without extension.
     */
    @JvmName("veoaujyerllbngaw")
    public suspend fun diskBlobName(`value`: Output) {
        this.diskBlobName = value
    }

    /**
     * @param value The size of the disk in Gibibytes.
     */
    @JvmName("hcvwbnyuppewpbdj")
    public suspend fun diskSizeGiB(`value`: Output) {
        this.diskSizeGiB = value
    }

    /**
     * @param value The storage type for the disk (i.e. Standard, Premium).
     */
    @JvmName("aedasptkskcyqrad")
    public suspend fun diskType(`value`: Output>) {
        this.diskType = value
    }

    /**
     * @param value When backed by a blob, the URI of underlying blob.
     */
    @JvmName("ooxdwwcdtbwtnvbe")
    public suspend fun diskUri(`value`: Output) {
        this.diskUri = value
    }

    /**
     * @param value The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
     */
    @JvmName("jhfqsaysjqmnjayh")
    public suspend fun hostCaching(`value`: Output) {
        this.hostCaching = value
    }

    /**
     * @param value The name of the lab.
     */
    @JvmName("xqpljcnbxxlcvhmt")
    public suspend fun labName(`value`: Output) {
        this.labName = value
    }

    /**
     * @param value The resource ID of the VM to which this disk is leased.
     */
    @JvmName("hxrwsdicrmchdpha")
    public suspend fun leasedByLabVmId(`value`: Output) {
        this.leasedByLabVmId = value
    }

    /**
     * @param value The location of the resource.
     */
    @JvmName("rhxyrgobwbhicuyi")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value When backed by managed disk, this is the ID of the compute disk resource.
     */
    @JvmName("mkxcyofxfsyikiwp")
    public suspend fun managedDiskId(`value`: Output) {
        this.managedDiskId = value
    }

    /**
     * @param value The name of the disk.
     */
    @JvmName("ibfodtdycbbyoyqj")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the resource group.
     */
    @JvmName("ujjgrfmevdbvnhlk")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value When backed by a blob, the storage account where the blob is.
     */
    @JvmName("qyuagkwuweejfcgv")
    public suspend fun storageAccountId(`value`: Output) {
        this.storageAccountId = value
    }

    /**
     * @param value The tags of the resource.
     */
    @JvmName("jyqlkgoqmbsjsqho")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The name of the user profile.
     */
    @JvmName("dflewfkexyjibjnf")
    public suspend fun userName(`value`: Output) {
        this.userName = value
    }

    /**
     * @param value When backed by a blob, the name of the VHD blob without extension.
     */
    @JvmName("wyuljsnjsmkumxvu")
    public suspend fun diskBlobName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.diskBlobName = mapped
    }

    /**
     * @param value The size of the disk in Gibibytes.
     */
    @JvmName("dfijuslkktcxxsqv")
    public suspend fun diskSizeGiB(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.diskSizeGiB = mapped
    }

    /**
     * @param value The storage type for the disk (i.e. Standard, Premium).
     */
    @JvmName("rlxwqilrxxpmbpat")
    public suspend fun diskType(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.diskType = mapped
    }

    /**
     * @param value The storage type for the disk (i.e. Standard, Premium).
     */
    @JvmName("foofvtgvkyrmixnv")
    public fun diskType(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.diskType = mapped
    }

    /**
     * @param value The storage type for the disk (i.e. Standard, Premium).
     */
    @JvmName("ktregeacbacycmht")
    public fun diskType(`value`: StorageType) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.diskType = mapped
    }

    /**
     * @param value When backed by a blob, the URI of underlying blob.
     */
    @JvmName("auhqkkrxepjfioes")
    public suspend fun diskUri(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.diskUri = mapped
    }

    /**
     * @param value The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite).
     */
    @JvmName("albimwtgwduauabd")
    public suspend fun hostCaching(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hostCaching = mapped
    }

    /**
     * @param value The name of the lab.
     */
    @JvmName("hksqygtufqonqnjs")
    public suspend fun labName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labName = mapped
    }

    /**
     * @param value The resource ID of the VM to which this disk is leased.
     */
    @JvmName("yrltaovwbisvifsq")
    public suspend fun leasedByLabVmId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.leasedByLabVmId = mapped
    }

    /**
     * @param value The location of the resource.
     */
    @JvmName("gvysctoeatnkrsvl")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value When backed by managed disk, this is the ID of the compute disk resource.
     */
    @JvmName("vsgnwbwbcjjkgpel")
    public suspend fun managedDiskId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.managedDiskId = mapped
    }

    /**
     * @param value The name of the disk.
     */
    @JvmName("qjennvcfkiaktjvp")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of the resource group.
     */
    @JvmName("nucfavatccgrvbnw")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value When backed by a blob, the storage account where the blob is.
     */
    @JvmName("lanphjkeorksbeut")
    public suspend fun storageAccountId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.storageAccountId = mapped
    }

    /**
     * @param value The tags of the resource.
     */
    @JvmName("pcnthcbwupbuokfp")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values The tags of the resource.
     */
    @JvmName("fdkjvvldsxqnnxfp")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The name of the user profile.
     */
    @JvmName("sbfefpfnjurhyygb")
    public suspend fun userName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.userName = mapped
    }

    internal fun build(): DiskArgs = DiskArgs(
        diskBlobName = diskBlobName,
        diskSizeGiB = diskSizeGiB,
        diskType = diskType,
        diskUri = diskUri,
        hostCaching = hostCaching,
        labName = labName,
        leasedByLabVmId = leasedByLabVmId,
        location = location,
        managedDiskId = managedDiskId,
        name = name,
        resourceGroupName = resourceGroupName,
        storageAccountId = storageAccountId,
        tags = tags,
        userName = userName,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy