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

com.pulumi.nomad.kotlin.VolumeArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.nomad.kotlin

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.nomad.VolumeArgs.builder
import com.pulumi.nomad.kotlin.inputs.VolumeCapabilityArgs
import com.pulumi.nomad.kotlin.inputs.VolumeCapabilityArgsBuilder
import com.pulumi.nomad.kotlin.inputs.VolumeMountOptionsArgs
import com.pulumi.nomad.kotlin.inputs.VolumeMountOptionsArgsBuilder
import com.pulumi.nomad.kotlin.inputs.VolumeTopologyRequestArgs
import com.pulumi.nomad.kotlin.inputs.VolumeTopologyRequestArgsBuilder
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * Registering a volume:
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as nomad from "@pulumi/nomad";
 * // It can sometimes be helpful to wait for a particular plugin to be available
 * const ebs = nomad.getPlugin({
 *     pluginId: "aws-ebs0",
 *     waitForHealthy: true,
 * });
 * const mysqlVolume = new nomad.Volume("mysql_volume", {
 *     type: "csi",
 *     pluginId: "aws-ebs0",
 *     volumeId: "mysql_volume",
 *     name: "mysql_volume",
 *     externalId: hashistack.ebsTestVolumeId,
 *     capabilities: [{
 *         accessMode: "single-node-writer",
 *         attachmentMode: "file-system",
 *     }],
 *     mountOptions: {
 *         fsType: "ext4",
 *     },
 *     topologyRequest: {
 *         required: {
 *             topologies: [
 *                 {
 *                     segments: {
 *                         rack: "R1",
 *                         zone: "us-east-1a",
 *                     },
 *                 },
 *                 {
 *                     segments: {
 *                         rack: "R2",
 *                     },
 *                 },
 *             ],
 *         },
 *     },
 * }, {
 *     dependsOn: [ebs],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_nomad as nomad
 * # It can sometimes be helpful to wait for a particular plugin to be available
 * ebs = nomad.get_plugin(plugin_id="aws-ebs0",
 *     wait_for_healthy=True)
 * mysql_volume = nomad.Volume("mysql_volume",
 *     type="csi",
 *     plugin_id="aws-ebs0",
 *     volume_id="mysql_volume",
 *     name="mysql_volume",
 *     external_id=hashistack["ebsTestVolumeId"],
 *     capabilities=[{
 *         "access_mode": "single-node-writer",
 *         "attachment_mode": "file-system",
 *     }],
 *     mount_options={
 *         "fs_type": "ext4",
 *     },
 *     topology_request={
 *         "required": {
 *             "topologies": [
 *                 {
 *                     "segments": {
 *                         "rack": "R1",
 *                         "zone": "us-east-1a",
 *                     },
 *                 },
 *                 {
 *                     "segments": {
 *                         "rack": "R2",
 *                     },
 *                 },
 *             ],
 *         },
 *     },
 *     opts = pulumi.ResourceOptions(depends_on=[ebs]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Nomad = Pulumi.Nomad;
 * return await Deployment.RunAsync(() =>
 * {
 *     // It can sometimes be helpful to wait for a particular plugin to be available
 *     var ebs = Nomad.GetPlugin.Invoke(new()
 *     {
 *         PluginId = "aws-ebs0",
 *         WaitForHealthy = true,
 *     });
 *     var mysqlVolume = new Nomad.Volume("mysql_volume", new()
 *     {
 *         Type = "csi",
 *         PluginId = "aws-ebs0",
 *         VolumeId = "mysql_volume",
 *         Name = "mysql_volume",
 *         ExternalId = hashistack.EbsTestVolumeId,
 *         Capabilities = new[]
 *         {
 *             new Nomad.Inputs.VolumeCapabilityArgs
 *             {
 *                 AccessMode = "single-node-writer",
 *                 AttachmentMode = "file-system",
 *             },
 *         },
 *         MountOptions = new Nomad.Inputs.VolumeMountOptionsArgs
 *         {
 *             FsType = "ext4",
 *         },
 *         TopologyRequest = new Nomad.Inputs.VolumeTopologyRequestArgs
 *         {
 *             Required = new Nomad.Inputs.VolumeTopologyRequestRequiredArgs
 *             {
 *                 Topologies = new[]
 *                 {
 *                     new Nomad.Inputs.VolumeTopologyRequestRequiredTopologyArgs
 *                     {
 *                         Segments =
 *                         {
 *                             { "rack", "R1" },
 *                             { "zone", "us-east-1a" },
 *                         },
 *                     },
 *                     new Nomad.Inputs.VolumeTopologyRequestRequiredTopologyArgs
 *                     {
 *                         Segments =
 *                         {
 *                             { "rack", "R2" },
 *                         },
 *                     },
 *                 },
 *             },
 *         },
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             ebs,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-nomad/sdk/v2/go/nomad"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		// It can sometimes be helpful to wait for a particular plugin to be available
 * 		ebs, err := nomad.GetPlugin(ctx, &nomad.GetPluginArgs{
 * 			PluginId:       "aws-ebs0",
 * 			WaitForHealthy: pulumi.BoolRef(true),
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = nomad.NewVolume(ctx, "mysql_volume", &nomad.VolumeArgs{
 * 			Type:       pulumi.String("csi"),
 * 			PluginId:   pulumi.String("aws-ebs0"),
 * 			VolumeId:   pulumi.String("mysql_volume"),
 * 			Name:       pulumi.String("mysql_volume"),
 * 			ExternalId: pulumi.Any(hashistack.EbsTestVolumeId),
 * 			Capabilities: nomad.VolumeCapabilityArray{
 * 				&nomad.VolumeCapabilityArgs{
 * 					AccessMode:     pulumi.String("single-node-writer"),
 * 					AttachmentMode: pulumi.String("file-system"),
 * 				},
 * 			},
 * 			MountOptions: &nomad.VolumeMountOptionsArgs{
 * 				FsType: pulumi.String("ext4"),
 * 			},
 * 			TopologyRequest: &nomad.VolumeTopologyRequestArgs{
 * 				Required: &nomad.VolumeTopologyRequestRequiredArgs{
 * 					Topologies: nomad.VolumeTopologyRequestRequiredTopologyArray{
 * 						&nomad.VolumeTopologyRequestRequiredTopologyArgs{
 * 							Segments: pulumi.StringMap{
 * 								"rack": pulumi.String("R1"),
 * 								"zone": pulumi.String("us-east-1a"),
 * 							},
 * 						},
 * 						&nomad.VolumeTopologyRequestRequiredTopologyArgs{
 * 							Segments: pulumi.StringMap{
 * 								"rack": pulumi.String("R2"),
 * 							},
 * 						},
 * 					},
 * 				},
 * 			},
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			ebs,
 * 		}))
 * 		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.nomad.NomadFunctions;
 * import com.pulumi.nomad.inputs.GetPluginArgs;
 * import com.pulumi.nomad.Volume;
 * import com.pulumi.nomad.VolumeArgs;
 * import com.pulumi.nomad.inputs.VolumeCapabilityArgs;
 * import com.pulumi.nomad.inputs.VolumeMountOptionsArgs;
 * import com.pulumi.nomad.inputs.VolumeTopologyRequestArgs;
 * import com.pulumi.nomad.inputs.VolumeTopologyRequestRequiredArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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) {
 *         // It can sometimes be helpful to wait for a particular plugin to be available
 *         final var ebs = NomadFunctions.getPlugin(GetPluginArgs.builder()
 *             .pluginId("aws-ebs0")
 *             .waitForHealthy(true)
 *             .build());
 *         var mysqlVolume = new Volume("mysqlVolume", VolumeArgs.builder()
 *             .type("csi")
 *             .pluginId("aws-ebs0")
 *             .volumeId("mysql_volume")
 *             .name("mysql_volume")
 *             .externalId(hashistack.ebsTestVolumeId())
 *             .capabilities(VolumeCapabilityArgs.builder()
 *                 .accessMode("single-node-writer")
 *                 .attachmentMode("file-system")
 *                 .build())
 *             .mountOptions(VolumeMountOptionsArgs.builder()
 *                 .fsType("ext4")
 *                 .build())
 *             .topologyRequest(VolumeTopologyRequestArgs.builder()
 *                 .required(VolumeTopologyRequestRequiredArgs.builder()
 *                     .topologies(
 *                         VolumeTopologyRequestRequiredTopologyArgs.builder()
 *                             .segments(Map.ofEntries(
 *                                 Map.entry("rack", "R1"),
 *                                 Map.entry("zone", "us-east-1a")
 *                             ))
 *                             .build(),
 *                         VolumeTopologyRequestRequiredTopologyArgs.builder()
 *                             .segments(Map.of("rack", "R2"))
 *                             .build())
 *                     .build())
 *                 .build())
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(ebs.applyValue(getPluginResult -> getPluginResult))
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   mysqlVolume:
 *     type: nomad:Volume
 *     name: mysql_volume
 *     properties:
 *       type: csi
 *       pluginId: aws-ebs0
 *       volumeId: mysql_volume
 *       name: mysql_volume
 *       externalId: ${hashistack.ebsTestVolumeId}
 *       capabilities:
 *         - accessMode: single-node-writer
 *           attachmentMode: file-system
 *       mountOptions:
 *         fsType: ext4
 *       topologyRequest:
 *         required:
 *           topologies:
 *             - segments:
 *                 rack: R1
 *                 zone: us-east-1a
 *             - segments:
 *                 rack: R2
 *     options:
 *       dependson:
 *         - ${ebs}
 * variables:
 *   # It can sometimes be helpful to wait for a particular plugin to be available
 *   ebs:
 *     fn::invoke:
 *       Function: nomad:getPlugin
 *       Arguments:
 *         pluginId: aws-ebs0
 *         waitForHealthy: true
 * ```
 * 
 * @property accessMode `(string: )` - **Deprecated**. Use `capability` block instead. Defines whether a volume should be available concurrently. Possible values are:
 * - `single-node-reader-only`
 * - `single-node-writer`
 * - `multi-node-reader-only`
 * - `multi-node-single-writer`
 * - `multi-node-multi-writer`
 * @property attachmentMode `(string: )` - **Deprecated**. Use `capability` block instead. The storage API that will be used by the volume.
 * @property capabilities `(``Capability``: )` - Options for validating the capability of a volume.
 * @property context `(map[string]string: )` - An optional key-value map of strings passed directly to the CSI plugin to validate the volume.
 * @property deregisterOnDestroy `(boolean: true)` - If true, the volume will be deregistered on destroy.
 * @property externalId `(string: )` - The ID of the physical volume from the storage provider.
 * @property mountOptions `(block: )` Options for mounting `block-device` volumes without a pre-formatted file system.
 * @property name `(string: )` - The display name for the volume.
 * @property namespace `(string: "default")` - The namespace in which to register the volume.
 * @property parameters `(map[string]string: )` - An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
 * @property pluginId `(string: )` - The ID of the Nomad plugin for registering this volume.
 * @property secrets `(map[string]string: )` - An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
 * @property topologyRequest `(``TopologyRequest``: )` - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
 * @property type `(string: )` - The type of the volume. Currently, only `csi` is supported.
 * @property volumeId `(string: )` - The unique ID of the volume.
 */
public data class VolumeArgs(
    @Deprecated(
        message = """
  use capability instead
  """,
    )
    public val accessMode: Output? = null,
    @Deprecated(
        message = """
  use capability instead
  """,
    )
    public val attachmentMode: Output? = null,
    public val capabilities: Output>? = null,
    public val context: Output>? = null,
    public val deregisterOnDestroy: Output? = null,
    public val externalId: Output? = null,
    public val mountOptions: Output? = null,
    public val name: Output? = null,
    public val namespace: Output? = null,
    public val parameters: Output>? = null,
    public val pluginId: Output? = null,
    public val secrets: Output>? = null,
    public val topologyRequest: Output? = null,
    public val type: Output? = null,
    public val volumeId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.nomad.VolumeArgs = com.pulumi.nomad.VolumeArgs.builder()
        .accessMode(accessMode?.applyValue({ args0 -> args0 }))
        .attachmentMode(attachmentMode?.applyValue({ args0 -> args0 }))
        .capabilities(
            capabilities?.applyValue({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                })
            }),
        )
        .context(context?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
        .deregisterOnDestroy(deregisterOnDestroy?.applyValue({ args0 -> args0 }))
        .externalId(externalId?.applyValue({ args0 -> args0 }))
        .mountOptions(mountOptions?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
        .name(name?.applyValue({ args0 -> args0 }))
        .namespace(namespace?.applyValue({ args0 -> args0 }))
        .parameters(
            parameters?.applyValue({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }),
        )
        .pluginId(pluginId?.applyValue({ args0 -> args0 }))
        .secrets(secrets?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
        .topologyRequest(topologyRequest?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
        .type(type?.applyValue({ args0 -> args0 }))
        .volumeId(volumeId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [VolumeArgs].
 */
@PulumiTagMarker
public class VolumeArgsBuilder internal constructor() {
    private var accessMode: Output? = null

    private var attachmentMode: Output? = null

    private var capabilities: Output>? = null

    private var context: Output>? = null

    private var deregisterOnDestroy: Output? = null

    private var externalId: Output? = null

    private var mountOptions: Output? = null

    private var name: Output? = null

    private var namespace: Output? = null

    private var parameters: Output>? = null

    private var pluginId: Output? = null

    private var secrets: Output>? = null

    private var topologyRequest: Output? = null

    private var type: Output? = null

    private var volumeId: Output? = null

    /**
     * @param value `(string: )` - **Deprecated**. Use `capability` block instead. Defines whether a volume should be available concurrently. Possible values are:
     * - `single-node-reader-only`
     * - `single-node-writer`
     * - `multi-node-reader-only`
     * - `multi-node-single-writer`
     * - `multi-node-multi-writer`
     */
    @Deprecated(
        message = """
  use capability instead
  """,
    )
    @JvmName("nhoodqbwocdenjsh")
    public suspend fun accessMode(`value`: Output) {
        this.accessMode = value
    }

    /**
     * @param value `(string: )` - **Deprecated**. Use `capability` block instead. The storage API that will be used by the volume.
     */
    @Deprecated(
        message = """
  use capability instead
  """,
    )
    @JvmName("idqfxijwypvmrhgj")
    public suspend fun attachmentMode(`value`: Output) {
        this.attachmentMode = value
    }

    /**
     * @param value `(``Capability``: )` - Options for validating the capability of a volume.
     */
    @JvmName("hwqpikksfnjtjmuu")
    public suspend fun capabilities(`value`: Output>) {
        this.capabilities = value
    }

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

    /**
     * @param values `(``Capability``: )` - Options for validating the capability of a volume.
     */
    @JvmName("xsifcoiqlcgnvkoh")
    public suspend fun capabilities(values: List>) {
        this.capabilities = Output.all(values)
    }

    /**
     * @param value `(map[string]string: )` - An optional key-value map of strings passed directly to the CSI plugin to validate the volume.
     */
    @JvmName("waptndhbyxnuvrcw")
    public suspend fun context(`value`: Output>) {
        this.context = value
    }

    /**
     * @param value `(boolean: true)` - If true, the volume will be deregistered on destroy.
     */
    @JvmName("vrvupowwkuhkwdys")
    public suspend fun deregisterOnDestroy(`value`: Output) {
        this.deregisterOnDestroy = value
    }

    /**
     * @param value `(string: )` - The ID of the physical volume from the storage provider.
     */
    @JvmName("belcpjgcvuxyjihb")
    public suspend fun externalId(`value`: Output) {
        this.externalId = value
    }

    /**
     * @param value `(block: )` Options for mounting `block-device` volumes without a pre-formatted file system.
     */
    @JvmName("ptgplgeneuokjsxn")
    public suspend fun mountOptions(`value`: Output) {
        this.mountOptions = value
    }

    /**
     * @param value `(string: )` - The display name for the volume.
     */
    @JvmName("bmauksfiwlvlqywr")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value `(string: "default")` - The namespace in which to register the volume.
     */
    @JvmName("yqtfpapinhihknem")
    public suspend fun namespace(`value`: Output) {
        this.namespace = value
    }

    /**
     * @param value `(map[string]string: )` - An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
     */
    @JvmName("tyjladwgdcdqcsyb")
    public suspend fun parameters(`value`: Output>) {
        this.parameters = value
    }

    /**
     * @param value `(string: )` - The ID of the Nomad plugin for registering this volume.
     */
    @JvmName("bmwxcbxbririxuid")
    public suspend fun pluginId(`value`: Output) {
        this.pluginId = value
    }

    /**
     * @param value `(map[string]string: )` - An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
     */
    @JvmName("kfkbyxweuhtquvuo")
    public suspend fun secrets(`value`: Output>) {
        this.secrets = value
    }

    /**
     * @param value `(``TopologyRequest``: )` - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
     */
    @JvmName("njgekuqetpadqhae")
    public suspend fun topologyRequest(`value`: Output) {
        this.topologyRequest = value
    }

    /**
     * @param value `(string: )` - The type of the volume. Currently, only `csi` is supported.
     */
    @JvmName("jriihnnjeruqdkvr")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value `(string: )` - The unique ID of the volume.
     */
    @JvmName("uyydwpnskkbayvry")
    public suspend fun volumeId(`value`: Output) {
        this.volumeId = value
    }

    /**
     * @param value `(string: )` - **Deprecated**. Use `capability` block instead. Defines whether a volume should be available concurrently. Possible values are:
     * - `single-node-reader-only`
     * - `single-node-writer`
     * - `multi-node-reader-only`
     * - `multi-node-single-writer`
     * - `multi-node-multi-writer`
     */
    @Deprecated(
        message = """
  use capability instead
  """,
    )
    @JvmName("yubplfmkcmpdbcdp")
    public suspend fun accessMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accessMode = mapped
    }

    /**
     * @param value `(string: )` - **Deprecated**. Use `capability` block instead. The storage API that will be used by the volume.
     */
    @Deprecated(
        message = """
  use capability instead
  """,
    )
    @JvmName("wemusunwenvxedvo")
    public suspend fun attachmentMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.attachmentMode = mapped
    }

    /**
     * @param value `(``Capability``: )` - Options for validating the capability of a volume.
     */
    @JvmName("mhxbgcpbmbabdvpd")
    public suspend fun capabilities(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.capabilities = mapped
    }

    /**
     * @param argument `(``Capability``: )` - Options for validating the capability of a volume.
     */
    @JvmName("wllienwhljtenrob")
    public suspend fun capabilities(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            VolumeCapabilityArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.capabilities = mapped
    }

    /**
     * @param argument `(``Capability``: )` - Options for validating the capability of a volume.
     */
    @JvmName("elpxgvfnxntfwpos")
    public suspend fun capabilities(vararg argument: suspend VolumeCapabilityArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            VolumeCapabilityArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.capabilities = mapped
    }

    /**
     * @param argument `(``Capability``: )` - Options for validating the capability of a volume.
     */
    @JvmName("lclrycpgdapdaabd")
    public suspend fun capabilities(argument: suspend VolumeCapabilityArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(VolumeCapabilityArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.capabilities = mapped
    }

    /**
     * @param values `(``Capability``: )` - Options for validating the capability of a volume.
     */
    @JvmName("bqaxfuyukwrdlrym")
    public suspend fun capabilities(vararg values: VolumeCapabilityArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.capabilities = mapped
    }

    /**
     * @param value `(map[string]string: )` - An optional key-value map of strings passed directly to the CSI plugin to validate the volume.
     */
    @JvmName("nvagqimhenrqpdty")
    public suspend fun context(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.context = mapped
    }

    /**
     * @param values `(map[string]string: )` - An optional key-value map of strings passed directly to the CSI plugin to validate the volume.
     */
    @JvmName("toueqxtmwnbfcfdj")
    public fun context(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.context = mapped
    }

    /**
     * @param value `(boolean: true)` - If true, the volume will be deregistered on destroy.
     */
    @JvmName("pikwrmifjeoxtgqr")
    public suspend fun deregisterOnDestroy(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deregisterOnDestroy = mapped
    }

    /**
     * @param value `(string: )` - The ID of the physical volume from the storage provider.
     */
    @JvmName("jimeevjipbdedknc")
    public suspend fun externalId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.externalId = mapped
    }

    /**
     * @param value `(block: )` Options for mounting `block-device` volumes without a pre-formatted file system.
     */
    @JvmName("lkxuggnvomtjygdi")
    public suspend fun mountOptions(`value`: VolumeMountOptionsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.mountOptions = mapped
    }

    /**
     * @param argument `(block: )` Options for mounting `block-device` volumes without a pre-formatted file system.
     */
    @JvmName("nbcstuioxhiinchj")
    public suspend fun mountOptions(argument: suspend VolumeMountOptionsArgsBuilder.() -> Unit) {
        val toBeMapped = VolumeMountOptionsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.mountOptions = mapped
    }

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

    /**
     * @param value `(string: "default")` - The namespace in which to register the volume.
     */
    @JvmName("vjqmndlsxsqrmtdb")
    public suspend fun namespace(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namespace = mapped
    }

    /**
     * @param value `(map[string]string: )` - An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
     */
    @JvmName("ogibwggiiugqdkls")
    public suspend fun parameters(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parameters = mapped
    }

    /**
     * @param values `(map[string]string: )` - An optional key-value map of strings passed directly to the CSI plugin to configure the volume.
     */
    @JvmName("pgplihkethwdbtsw")
    public fun parameters(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.parameters = mapped
    }

    /**
     * @param value `(string: )` - The ID of the Nomad plugin for registering this volume.
     */
    @JvmName("hqtilsuwaynjhgws")
    public suspend fun pluginId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.pluginId = mapped
    }

    /**
     * @param value `(map[string]string: )` - An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
     */
    @JvmName("echybqqcgkhytdbc")
    public suspend fun secrets(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secrets = mapped
    }

    /**
     * @param values `(map[string]string: )` - An optional key-value map of strings used as credentials for publishing and unpublishing volumes.
     */
    @JvmName("wfxytnshtgbmxahs")
    public fun secrets(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.secrets = mapped
    }

    /**
     * @param value `(``TopologyRequest``: )` - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
     */
    @JvmName("yawqvmmasuhsswim")
    public suspend fun topologyRequest(`value`: VolumeTopologyRequestArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.topologyRequest = mapped
    }

    /**
     * @param argument `(``TopologyRequest``: )` - Specify locations (region, zone, rack, etc.) where the provisioned volume is accessible from.
     */
    @JvmName("mmyemjfvpjcpocwp")
    public suspend fun topologyRequest(argument: suspend VolumeTopologyRequestArgsBuilder.() -> Unit) {
        val toBeMapped = VolumeTopologyRequestArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.topologyRequest = mapped
    }

    /**
     * @param value `(string: )` - The type of the volume. Currently, only `csi` is supported.
     */
    @JvmName("rjcufmytwbcmcenb")
    public suspend fun type(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    /**
     * @param value `(string: )` - The unique ID of the volume.
     */
    @JvmName("ipocgxenthnntigt")
    public suspend fun volumeId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.volumeId = mapped
    }

    internal fun build(): VolumeArgs = VolumeArgs(
        accessMode = accessMode,
        attachmentMode = attachmentMode,
        capabilities = capabilities,
        context = context,
        deregisterOnDestroy = deregisterOnDestroy,
        externalId = externalId,
        mountOptions = mountOptions,
        name = name,
        namespace = namespace,
        parameters = parameters,
        pluginId = pluginId,
        secrets = secrets,
        topologyRequest = topologyRequest,
        type = type,
        volumeId = volumeId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy