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

com.pulumi.azurenative.azurestackhci.kotlin.GalleryImageArgs.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.azurestackhci.kotlin

import com.pulumi.azurenative.azurestackhci.GalleryImageArgs.builder
import com.pulumi.azurenative.azurestackhci.kotlin.enums.CloudInitDataSource
import com.pulumi.azurenative.azurestackhci.kotlin.enums.HyperVGeneration
import com.pulumi.azurenative.azurestackhci.kotlin.enums.OperatingSystemTypes
import com.pulumi.azurenative.azurestackhci.kotlin.inputs.ExtendedLocationArgs
import com.pulumi.azurenative.azurestackhci.kotlin.inputs.ExtendedLocationArgsBuilder
import com.pulumi.azurenative.azurestackhci.kotlin.inputs.GalleryImageIdentifierArgs
import com.pulumi.azurenative.azurestackhci.kotlin.inputs.GalleryImageIdentifierArgsBuilder
import com.pulumi.azurenative.azurestackhci.kotlin.inputs.GalleryImageVersionArgs
import com.pulumi.azurenative.azurestackhci.kotlin.inputs.GalleryImageVersionArgsBuilder
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 com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * The gallery images resource definition.
 * Azure REST API version: 2022-12-15-preview.
 * Other available API versions: 2023-07-01-preview, 2023-09-01-preview, 2024-01-01, 2024-02-01-preview, 2024-05-01-preview.
 * ## Example Usage
 * ### PutGalleryImage
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var galleryImage = new AzureNative.AzureStackHCI.GalleryImage("galleryImage", new()
 *     {
 *         ContainerName = "Default_Container",
 *         ExtendedLocation = new AzureNative.AzureStackHCI.Inputs.ExtendedLocationArgs
 *         {
 *             Name = "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
 *             Type = AzureNative.AzureStackHCI.ExtendedLocationTypes.CustomLocation,
 *         },
 *         GalleryImageName = "test-gallery-image",
 *         ImagePath = "C:\\test.vhdx",
 *         Location = "West US2",
 *         ResourceGroupName = "test-rg",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	azurestackhci "github.com/pulumi/pulumi-azure-native-sdk/azurestackhci/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := azurestackhci.NewGalleryImage(ctx, "galleryImage", &azurestackhci.GalleryImageArgs{
 * 			ContainerName: pulumi.String("Default_Container"),
 * 			ExtendedLocation: &azurestackhci.ExtendedLocationArgs{
 * 				Name: pulumi.String("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"),
 * 				Type: pulumi.String(azurestackhci.ExtendedLocationTypesCustomLocation),
 * 			},
 * 			GalleryImageName:  pulumi.String("test-gallery-image"),
 * 			ImagePath:         pulumi.String("C:\\test.vhdx"),
 * 			Location:          pulumi.String("West US2"),
 * 			ResourceGroupName: pulumi.String("test-rg"),
 * 		})
 * 		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.azurestackhci.GalleryImage;
 * import com.pulumi.azurenative.azurestackhci.GalleryImageArgs;
 * import com.pulumi.azurenative.azurestackhci.inputs.ExtendedLocationArgs;
 * 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 galleryImage = new GalleryImage("galleryImage", GalleryImageArgs.builder()
 *             .containerName("Default_Container")
 *             .extendedLocation(ExtendedLocationArgs.builder()
 *                 .name("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")
 *                 .type("CustomLocation")
 *                 .build())
 *             .galleryImageName("test-gallery-image")
 *             .imagePath("C:\\test.vhdx")
 *             .location("West US2")
 *             .resourceGroupName("test-rg")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:azurestackhci:GalleryImage test-gallery-image /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}
 * ```
 * @property cloudInitDataSource Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure]
 * @property containerName Container Name for storage container
 * @property extendedLocation The extendedLocation of the resource.
 * @property galleryImageName Name of the gallery image
 * @property hyperVGeneration The hypervisor generation of the Virtual Machine [V1, V2]
 * @property identifier This is the gallery image definition identifier.
 * @property imagePath location of the image the gallery image should be created from
 * @property location The geo-location where the resource lives
 * @property osType Operating system type that the gallery image uses [Windows, Linux]
 * @property resourceGroupName The name of the resource group. The name is case insensitive.
 * @property tags Resource tags.
 * @property version Specifies information about the gallery image version that you want to create or update.
 */
public data class GalleryImageArgs(
    public val cloudInitDataSource: Output>? = null,
    public val containerName: Output? = null,
    public val extendedLocation: Output? = null,
    public val galleryImageName: Output? = null,
    public val hyperVGeneration: Output>? = null,
    public val identifier: Output? = null,
    public val imagePath: Output? = null,
    public val location: Output? = null,
    public val osType: Output? = null,
    public val resourceGroupName: Output? = null,
    public val tags: Output>? = null,
    public val version: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.azurestackhci.GalleryImageArgs =
        com.pulumi.azurenative.azurestackhci.GalleryImageArgs.builder()
            .cloudInitDataSource(
                cloudInitDataSource?.applyValue({ args0 ->
                    args0.transform(
                        { args0 -> args0 },
                        { args0 -> args0.let({ args0 -> args0.toJava() }) },
                    )
                }),
            )
            .containerName(containerName?.applyValue({ args0 -> args0 }))
            .extendedLocation(extendedLocation?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .galleryImageName(galleryImageName?.applyValue({ args0 -> args0 }))
            .hyperVGeneration(
                hyperVGeneration?.applyValue({ args0 ->
                    args0.transform(
                        { args0 -> args0 },
                        { args0 -> args0.let({ args0 -> args0.toJava() }) },
                    )
                }),
            )
            .identifier(identifier?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .imagePath(imagePath?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .osType(osType?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .version(version?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [GalleryImageArgs].
 */
@PulumiTagMarker
public class GalleryImageArgsBuilder internal constructor() {
    private var cloudInitDataSource: Output>? = null

    private var containerName: Output? = null

    private var extendedLocation: Output? = null

    private var galleryImageName: Output? = null

    private var hyperVGeneration: Output>? = null

    private var identifier: Output? = null

    private var imagePath: Output? = null

    private var location: Output? = null

    private var osType: Output? = null

    private var resourceGroupName: Output? = null

    private var tags: Output>? = null

    private var version: Output? = null

    /**
     * @param value Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure]
     */
    @JvmName("pbexcfxpcfbpaanf")
    public suspend fun cloudInitDataSource(`value`: Output>) {
        this.cloudInitDataSource = value
    }

    /**
     * @param value Container Name for storage container
     */
    @JvmName("nighibpbhvvppsmk")
    public suspend fun containerName(`value`: Output) {
        this.containerName = value
    }

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

    /**
     * @param value Name of the gallery image
     */
    @JvmName("ubhcawpfjdbaifpc")
    public suspend fun galleryImageName(`value`: Output) {
        this.galleryImageName = value
    }

    /**
     * @param value The hypervisor generation of the Virtual Machine [V1, V2]
     */
    @JvmName("chuslpsisujwgwko")
    public suspend fun hyperVGeneration(`value`: Output>) {
        this.hyperVGeneration = value
    }

    /**
     * @param value This is the gallery image definition identifier.
     */
    @JvmName("swfbrphdrhjviexm")
    public suspend fun identifier(`value`: Output) {
        this.identifier = value
    }

    /**
     * @param value location of the image the gallery image should be created from
     */
    @JvmName("wcoiwtweuqekgwve")
    public suspend fun imagePath(`value`: Output) {
        this.imagePath = value
    }

    /**
     * @param value The geo-location where the resource lives
     */
    @JvmName("hkoudclxmxyaflpd")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Operating system type that the gallery image uses [Windows, Linux]
     */
    @JvmName("cmhfifuxtnqgjgpy")
    public suspend fun osType(`value`: Output) {
        this.osType = value
    }

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

    /**
     * @param value Resource tags.
     */
    @JvmName("lvephdxnbnyamxhc")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Specifies information about the gallery image version that you want to create or update.
     */
    @JvmName("cktouaxplpmifrvu")
    public suspend fun version(`value`: Output) {
        this.version = value
    }

    /**
     * @param value Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure]
     */
    @JvmName("bgetaeedpklmsobf")
    public suspend fun cloudInitDataSource(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cloudInitDataSource = mapped
    }

    /**
     * @param value Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure]
     */
    @JvmName("gqbdjpqmbsylmvpa")
    public fun cloudInitDataSource(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.cloudInitDataSource = mapped
    }

    /**
     * @param value Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure]
     */
    @JvmName("dymgxljtvbfjyast")
    public fun cloudInitDataSource(`value`: CloudInitDataSource) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.cloudInitDataSource = mapped
    }

    /**
     * @param value Container Name for storage container
     */
    @JvmName("ekytuxfqjclhigqi")
    public suspend fun containerName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.containerName = mapped
    }

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

    /**
     * @param argument The extendedLocation of the resource.
     */
    @JvmName("qyghfipbcqyjcoha")
    public suspend fun extendedLocation(argument: suspend ExtendedLocationArgsBuilder.() -> Unit) {
        val toBeMapped = ExtendedLocationArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.extendedLocation = mapped
    }

    /**
     * @param value Name of the gallery image
     */
    @JvmName("ffscaqbupresnyoh")
    public suspend fun galleryImageName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.galleryImageName = mapped
    }

    /**
     * @param value The hypervisor generation of the Virtual Machine [V1, V2]
     */
    @JvmName("sgjtwxidktbqnmrp")
    public suspend fun hyperVGeneration(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hyperVGeneration = mapped
    }

    /**
     * @param value The hypervisor generation of the Virtual Machine [V1, V2]
     */
    @JvmName("pwdvbwxkhunwqluw")
    public fun hyperVGeneration(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.hyperVGeneration = mapped
    }

    /**
     * @param value The hypervisor generation of the Virtual Machine [V1, V2]
     */
    @JvmName("kiqsmwgicngvrpbf")
    public fun hyperVGeneration(`value`: HyperVGeneration) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.hyperVGeneration = mapped
    }

    /**
     * @param value This is the gallery image definition identifier.
     */
    @JvmName("nigcdfinuaqldmkv")
    public suspend fun identifier(`value`: GalleryImageIdentifierArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identifier = mapped
    }

    /**
     * @param argument This is the gallery image definition identifier.
     */
    @JvmName("hnbenndjhddekqja")
    public suspend fun identifier(argument: suspend GalleryImageIdentifierArgsBuilder.() -> Unit) {
        val toBeMapped = GalleryImageIdentifierArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identifier = mapped
    }

    /**
     * @param value location of the image the gallery image should be created from
     */
    @JvmName("iwdjwbnnxbuevxxd")
    public suspend fun imagePath(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.imagePath = mapped
    }

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

    /**
     * @param value Operating system type that the gallery image uses [Windows, Linux]
     */
    @JvmName("deuskfxkgbucrafm")
    public suspend fun osType(`value`: OperatingSystemTypes?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.osType = mapped
    }

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

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

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

    /**
     * @param value Specifies information about the gallery image version that you want to create or update.
     */
    @JvmName("ykqbewcgceixtfvv")
    public suspend fun version(`value`: GalleryImageVersionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.version = mapped
    }

    /**
     * @param argument Specifies information about the gallery image version that you want to create or update.
     */
    @JvmName("oytgxlrhsobmubke")
    public suspend fun version(argument: suspend GalleryImageVersionArgsBuilder.() -> Unit) {
        val toBeMapped = GalleryImageVersionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.version = mapped
    }

    internal fun build(): GalleryImageArgs = GalleryImageArgs(
        cloudInitDataSource = cloudInitDataSource,
        containerName = containerName,
        extendedLocation = extendedLocation,
        galleryImageName = galleryImageName,
        hyperVGeneration = hyperVGeneration,
        identifier = identifier,
        imagePath = imagePath,
        location = location,
        osType = osType,
        resourceGroupName = resourceGroupName,
        tags = tags,
        version = version,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy