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

com.pulumi.azurenative.storage.kotlin.FileShareArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.storage.kotlin

import com.pulumi.azurenative.storage.FileShareArgs.builder
import com.pulumi.azurenative.storage.kotlin.enums.EnabledProtocols
import com.pulumi.azurenative.storage.kotlin.enums.RootSquashType
import com.pulumi.azurenative.storage.kotlin.enums.ShareAccessTier
import com.pulumi.azurenative.storage.kotlin.inputs.SignedIdentifierArgs
import com.pulumi.azurenative.storage.kotlin.inputs.SignedIdentifierArgsBuilder
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.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Properties of the file share, including Id, resource name, resource type, Etag.
 * Azure REST API version: 2022-09-01. Prior API version in Azure Native 1.x: 2021-02-01.
 * Other available API versions: 2023-01-01, 2023-04-01, 2023-05-01.
 * ## Example Usage
 * ### Create NFS Shares
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var fileShare = new AzureNative.Storage.FileShare("fileShare", new()
 *     {
 *         AccountName = "sto666",
 *         EnabledProtocols = AzureNative.Storage.EnabledProtocols.NFS,
 *         ResourceGroupName = "res346",
 *         ShareName = "share1235",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	storage "github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := storage.NewFileShare(ctx, "fileShare", &storage.FileShareArgs{
 * 			AccountName:       pulumi.String("sto666"),
 * 			EnabledProtocols:  pulumi.String(storage.EnabledProtocolsNFS),
 * 			ResourceGroupName: pulumi.String("res346"),
 * 			ShareName:         pulumi.String("share1235"),
 * 		})
 * 		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.storage.FileShare;
 * import com.pulumi.azurenative.storage.FileShareArgs;
 * 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 fileShare = new FileShare("fileShare", FileShareArgs.builder()
 *             .accountName("sto666")
 *             .enabledProtocols("NFS")
 *             .resourceGroupName("res346")
 *             .shareName("share1235")
 *             .build());
 *     }
 * }
 * ```
 * ### PutShares
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var fileShare = new AzureNative.Storage.FileShare("fileShare", new()
 *     {
 *         AccountName = "sto328",
 *         ResourceGroupName = "res3376",
 *         ShareName = "share6185",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	storage "github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := storage.NewFileShare(ctx, "fileShare", &storage.FileShareArgs{
 * 			AccountName:       pulumi.String("sto328"),
 * 			ResourceGroupName: pulumi.String("res3376"),
 * 			ShareName:         pulumi.String("share6185"),
 * 		})
 * 		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.storage.FileShare;
 * import com.pulumi.azurenative.storage.FileShareArgs;
 * 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 fileShare = new FileShare("fileShare", FileShareArgs.builder()
 *             .accountName("sto328")
 *             .resourceGroupName("res3376")
 *             .shareName("share6185")
 *             .build());
 *     }
 * }
 * ```
 * ### PutShares with Access Tier
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var fileShare = new AzureNative.Storage.FileShare("fileShare", new()
 *     {
 *         AccessTier = AzureNative.Storage.ShareAccessTier.Hot,
 *         AccountName = "sto666",
 *         ResourceGroupName = "res346",
 *         ShareName = "share1235",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	storage "github.com/pulumi/pulumi-azure-native-sdk/storage/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := storage.NewFileShare(ctx, "fileShare", &storage.FileShareArgs{
 * 			AccessTier:        pulumi.String(storage.ShareAccessTierHot),
 * 			AccountName:       pulumi.String("sto666"),
 * 			ResourceGroupName: pulumi.String("res346"),
 * 			ShareName:         pulumi.String("share1235"),
 * 		})
 * 		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.storage.FileShare;
 * import com.pulumi.azurenative.storage.FileShareArgs;
 * 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 fileShare = new FileShare("fileShare", FileShareArgs.builder()
 *             .accessTier("Hot")
 *             .accountName("sto666")
 *             .resourceGroupName("res346")
 *             .shareName("share1235")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:storage:FileShare share1235 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}
 * ```
 * @property accessTier Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.
 * @property accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
 * @property enabledProtocols The authentication protocol that is used for the file share. Can only be specified when creating a share.
 * @property expand Optional, used to expand the properties within share's properties. Valid values are: snapshots. Should be passed as a string with delimiter ','
 * @property metadata A name-value pair to associate with the share as metadata.
 * @property resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
 * @property rootSquash The property is for NFS share only. The default is NoRootSquash.
 * @property shareName The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.
 * @property shareQuota The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.
 * @property signedIdentifiers List of stored access policies specified on the share.
 */
public data class FileShareArgs(
    public val accessTier: Output>? = null,
    public val accountName: Output? = null,
    public val enabledProtocols: Output>? = null,
    public val expand: Output? = null,
    public val metadata: Output>? = null,
    public val resourceGroupName: Output? = null,
    public val rootSquash: Output>? = null,
    public val shareName: Output? = null,
    public val shareQuota: Output? = null,
    public val signedIdentifiers: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.storage.FileShareArgs =
        com.pulumi.azurenative.storage.FileShareArgs.builder()
            .accessTier(
                accessTier?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .accountName(accountName?.applyValue({ args0 -> args0 }))
            .enabledProtocols(
                enabledProtocols?.applyValue({ args0 ->
                    args0.transform(
                        { args0 -> args0 },
                        { args0 -> args0.let({ args0 -> args0.toJava() }) },
                    )
                }),
            )
            .expand(expand?.applyValue({ args0 -> args0 }))
            .metadata(
                metadata?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .rootSquash(
                rootSquash?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .shareName(shareName?.applyValue({ args0 -> args0 }))
            .shareQuota(shareQuota?.applyValue({ args0 -> args0 }))
            .signedIdentifiers(
                signedIdentifiers?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

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

    private var accountName: Output? = null

    private var enabledProtocols: Output>? = null

    private var expand: Output? = null

    private var metadata: Output>? = null

    private var resourceGroupName: Output? = null

    private var rootSquash: Output>? = null

    private var shareName: Output? = null

    private var shareQuota: Output? = null

    private var signedIdentifiers: Output>? = null

    /**
     * @param value Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.
     */
    @JvmName("dhwwkrswnjrtqhim")
    public suspend fun accessTier(`value`: Output>) {
        this.accessTier = value
    }

    /**
     * @param value The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
     */
    @JvmName("xdmiwdrhjybkggtq")
    public suspend fun accountName(`value`: Output) {
        this.accountName = value
    }

    /**
     * @param value The authentication protocol that is used for the file share. Can only be specified when creating a share.
     */
    @JvmName("rwrbjxhscxstldbv")
    public suspend fun enabledProtocols(`value`: Output>) {
        this.enabledProtocols = value
    }

    /**
     * @param value Optional, used to expand the properties within share's properties. Valid values are: snapshots. Should be passed as a string with delimiter ','
     */
    @JvmName("jdeknlwnlwvbriud")
    public suspend fun expand(`value`: Output) {
        this.expand = value
    }

    /**
     * @param value A name-value pair to associate with the share as metadata.
     */
    @JvmName("croveaxalmbaulrh")
    public suspend fun metadata(`value`: Output>) {
        this.metadata = value
    }

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

    /**
     * @param value The property is for NFS share only. The default is NoRootSquash.
     */
    @JvmName("amspuiepnmmgyxmx")
    public suspend fun rootSquash(`value`: Output>) {
        this.rootSquash = value
    }

    /**
     * @param value The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.
     */
    @JvmName("lnrlrlhfjmlfcrlq")
    public suspend fun shareName(`value`: Output) {
        this.shareName = value
    }

    /**
     * @param value The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.
     */
    @JvmName("lmqmmtrxurgshsdf")
    public suspend fun shareQuota(`value`: Output) {
        this.shareQuota = value
    }

    /**
     * @param value List of stored access policies specified on the share.
     */
    @JvmName("jswtuixnibmyrjgv")
    public suspend fun signedIdentifiers(`value`: Output>) {
        this.signedIdentifiers = value
    }

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

    /**
     * @param values List of stored access policies specified on the share.
     */
    @JvmName("xrgfnnheaitpcydu")
    public suspend fun signedIdentifiers(values: List>) {
        this.signedIdentifiers = Output.all(values)
    }

    /**
     * @param value Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.
     */
    @JvmName("wmncwmtsiyswqguk")
    public suspend fun accessTier(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accessTier = mapped
    }

    /**
     * @param value Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.
     */
    @JvmName("pxmmusrobnflqhos")
    public fun accessTier(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.accessTier = mapped
    }

    /**
     * @param value Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.
     */
    @JvmName("wwqmkfhypakfqqlo")
    public fun accessTier(`value`: ShareAccessTier) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.accessTier = mapped
    }

    /**
     * @param value The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
     */
    @JvmName("sygagmwctafajwwc")
    public suspend fun accountName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accountName = mapped
    }

    /**
     * @param value The authentication protocol that is used for the file share. Can only be specified when creating a share.
     */
    @JvmName("aaslsdkqdvslccnh")
    public suspend fun enabledProtocols(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabledProtocols = mapped
    }

    /**
     * @param value The authentication protocol that is used for the file share. Can only be specified when creating a share.
     */
    @JvmName("ilmepqutjntfwsoa")
    public fun enabledProtocols(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.enabledProtocols = mapped
    }

    /**
     * @param value The authentication protocol that is used for the file share. Can only be specified when creating a share.
     */
    @JvmName("soayvysypoxsnfrk")
    public fun enabledProtocols(`value`: EnabledProtocols) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.enabledProtocols = mapped
    }

    /**
     * @param value Optional, used to expand the properties within share's properties. Valid values are: snapshots. Should be passed as a string with delimiter ','
     */
    @JvmName("moqkrkhsuxmaiqpa")
    public suspend fun expand(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expand = mapped
    }

    /**
     * @param value A name-value pair to associate with the share as metadata.
     */
    @JvmName("abfdueijukhydejy")
    public suspend fun metadata(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metadata = mapped
    }

    /**
     * @param values A name-value pair to associate with the share as metadata.
     */
    @JvmName("yyyvdfoqmippwgsu")
    public fun metadata(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metadata = mapped
    }

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

    /**
     * @param value The property is for NFS share only. The default is NoRootSquash.
     */
    @JvmName("tkcqbadxbxkmevjx")
    public suspend fun rootSquash(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rootSquash = mapped
    }

    /**
     * @param value The property is for NFS share only. The default is NoRootSquash.
     */
    @JvmName("jlpfpoddrtjgpgxq")
    public fun rootSquash(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.rootSquash = mapped
    }

    /**
     * @param value The property is for NFS share only. The default is NoRootSquash.
     */
    @JvmName("xehagvwglwpyrcaq")
    public fun rootSquash(`value`: RootSquashType) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.rootSquash = mapped
    }

    /**
     * @param value The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.
     */
    @JvmName("uokbqxodkbppsboc")
    public suspend fun shareName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.shareName = mapped
    }

    /**
     * @param value The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.
     */
    @JvmName("imsuuaotxeepspji")
    public suspend fun shareQuota(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.shareQuota = mapped
    }

    /**
     * @param value List of stored access policies specified on the share.
     */
    @JvmName("hcwvoxsrksqvaofn")
    public suspend fun signedIdentifiers(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.signedIdentifiers = mapped
    }

    /**
     * @param argument List of stored access policies specified on the share.
     */
    @JvmName("rflaqqqkweydfjxr")
    public suspend fun signedIdentifiers(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            SignedIdentifierArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.signedIdentifiers = mapped
    }

    /**
     * @param argument List of stored access policies specified on the share.
     */
    @JvmName("krulyvgsndkptjkx")
    public suspend fun signedIdentifiers(vararg argument: suspend SignedIdentifierArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            SignedIdentifierArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.signedIdentifiers = mapped
    }

    /**
     * @param argument List of stored access policies specified on the share.
     */
    @JvmName("hqmoodgdqjqpgrlm")
    public suspend fun signedIdentifiers(argument: suspend SignedIdentifierArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(SignedIdentifierArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.signedIdentifiers = mapped
    }

    /**
     * @param values List of stored access policies specified on the share.
     */
    @JvmName("bgfwhukwsoxvmsih")
    public suspend fun signedIdentifiers(vararg values: SignedIdentifierArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.signedIdentifiers = mapped
    }

    internal fun build(): FileShareArgs = FileShareArgs(
        accessTier = accessTier,
        accountName = accountName,
        enabledProtocols = enabledProtocols,
        expand = expand,
        metadata = metadata,
        resourceGroupName = resourceGroupName,
        rootSquash = rootSquash,
        shareName = shareName,
        shareQuota = shareQuota,
        signedIdentifiers = signedIdentifiers,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy