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

com.pulumi.azure.storage.kotlin.ShareFileArgs.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: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.storage.kotlin

import com.pulumi.azure.storage.ShareFileArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "azureteststorage",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "LRS",
 * });
 * const exampleShare = new azure.storage.Share("example", {
 *     name: "sharename",
 *     storageAccountName: exampleAccount.name,
 *     quota: 50,
 * });
 * const exampleShareFile = new azure.storage.ShareFile("example", {
 *     name: "my-awesome-content.zip",
 *     storageShareId: exampleShare.id,
 *     source: "some-local-file.zip",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_account = azure.storage.Account("example",
 *     name="azureteststorage",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     account_tier="Standard",
 *     account_replication_type="LRS")
 * example_share = azure.storage.Share("example",
 *     name="sharename",
 *     storage_account_name=example_account.name,
 *     quota=50)
 * example_share_file = azure.storage.ShareFile("example",
 *     name="my-awesome-content.zip",
 *     storage_share_id=example_share.id,
 *     source="some-local-file.zip")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleAccount = new Azure.Storage.Account("example", new()
 *     {
 *         Name = "azureteststorage",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AccountTier = "Standard",
 *         AccountReplicationType = "LRS",
 *     });
 *     var exampleShare = new Azure.Storage.Share("example", new()
 *     {
 *         Name = "sharename",
 *         StorageAccountName = exampleAccount.Name,
 *         Quota = 50,
 *     });
 *     var exampleShareFile = new Azure.Storage.ShareFile("example", new()
 *     {
 *         Name = "my-awesome-content.zip",
 *         StorageShareId = exampleShare.Id,
 *         Source = "some-local-file.zip",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
 * 			Name:                   pulumi.String("azureteststorage"),
 * 			ResourceGroupName:      example.Name,
 * 			Location:               example.Location,
 * 			AccountTier:            pulumi.String("Standard"),
 * 			AccountReplicationType: pulumi.String("LRS"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleShare, err := storage.NewShare(ctx, "example", &storage.ShareArgs{
 * 			Name:               pulumi.String("sharename"),
 * 			StorageAccountName: exampleAccount.Name,
 * 			Quota:              pulumi.Int(50),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = storage.NewShareFile(ctx, "example", &storage.ShareFileArgs{
 * 			Name:           pulumi.String("my-awesome-content.zip"),
 * 			StorageShareId: exampleShare.ID(),
 * 			Source:         pulumi.String("some-local-file.zip"),
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.storage.Share;
 * import com.pulumi.azure.storage.ShareArgs;
 * import com.pulumi.azure.storage.ShareFile;
 * import com.pulumi.azure.storage.ShareFileArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("azureteststorage")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .accountTier("Standard")
 *             .accountReplicationType("LRS")
 *             .build());
 *         var exampleShare = new Share("exampleShare", ShareArgs.builder()
 *             .name("sharename")
 *             .storageAccountName(exampleAccount.name())
 *             .quota(50)
 *             .build());
 *         var exampleShareFile = new ShareFile("exampleShareFile", ShareFileArgs.builder()
 *             .name("my-awesome-content.zip")
 *             .storageShareId(exampleShare.id())
 *             .source("some-local-file.zip")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleAccount:
 *     type: azure:storage:Account
 *     name: example
 *     properties:
 *       name: azureteststorage
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       accountTier: Standard
 *       accountReplicationType: LRS
 *   exampleShare:
 *     type: azure:storage:Share
 *     name: example
 *     properties:
 *       name: sharename
 *       storageAccountName: ${exampleAccount.name}
 *       quota: 50
 *   exampleShareFile:
 *     type: azure:storage:ShareFile
 *     name: example
 *     properties:
 *       name: my-awesome-content.zip
 *       storageShareId: ${exampleShare.id}
 *       source: some-local-file.zip
 * ```
 * 
 * ## Import
 * Directories within an Azure Storage File Share can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:storage/shareFile:ShareFile example https://account1.file.core.windows.net/share1/file1
 * ```
 * @property contentDisposition Sets the file’s Content-Disposition header.
 * @property contentEncoding Specifies which content encodings have been applied to the file.
 * @property contentMd5
 * @property contentType The content type of the share file. Defaults to `application/octet-stream`.
 * @property metadata A mapping of metadata to assign to this file.
 * @property name The name (or path) of the File that should be created within this File Share. Changing this forces a new resource to be created.
 * @property path The storage share directory that you would like the file placed into. Changing this forces a new resource to be created. Defaults to `""`.
 * @property source An absolute path to a file on the local system. Changing this forces a new resource to be created.
 * > **Note** The file specified with `source` can not be empty.
 * @property storageShareId The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
 */
public data class ShareFileArgs(
    public val contentDisposition: Output? = null,
    public val contentEncoding: Output? = null,
    public val contentMd5: Output? = null,
    public val contentType: Output? = null,
    public val metadata: Output>? = null,
    public val name: Output? = null,
    public val path: Output? = null,
    public val source: Output? = null,
    public val storageShareId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.storage.ShareFileArgs =
        com.pulumi.azure.storage.ShareFileArgs.builder()
            .contentDisposition(contentDisposition?.applyValue({ args0 -> args0 }))
            .contentEncoding(contentEncoding?.applyValue({ args0 -> args0 }))
            .contentMd5(contentMd5?.applyValue({ args0 -> args0 }))
            .contentType(contentType?.applyValue({ args0 -> args0 }))
            .metadata(
                metadata?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .name(name?.applyValue({ args0 -> args0 }))
            .path(path?.applyValue({ args0 -> args0 }))
            .source(source?.applyValue({ args0 -> args0 }))
            .storageShareId(storageShareId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ShareFileArgs].
 */
@PulumiTagMarker
public class ShareFileArgsBuilder internal constructor() {
    private var contentDisposition: Output? = null

    private var contentEncoding: Output? = null

    private var contentMd5: Output? = null

    private var contentType: Output? = null

    private var metadata: Output>? = null

    private var name: Output? = null

    private var path: Output? = null

    private var source: Output? = null

    private var storageShareId: Output? = null

    /**
     * @param value Sets the file’s Content-Disposition header.
     */
    @JvmName("niqgftmbiofwdwvc")
    public suspend fun contentDisposition(`value`: Output) {
        this.contentDisposition = value
    }

    /**
     * @param value Specifies which content encodings have been applied to the file.
     */
    @JvmName("ymqwusqfixglrxsa")
    public suspend fun contentEncoding(`value`: Output) {
        this.contentEncoding = value
    }

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

    /**
     * @param value The content type of the share file. Defaults to `application/octet-stream`.
     */
    @JvmName("vdirhlgabbtnyxgi")
    public suspend fun contentType(`value`: Output) {
        this.contentType = value
    }

    /**
     * @param value A mapping of metadata to assign to this file.
     */
    @JvmName("pnyehvgjwvcgvpli")
    public suspend fun metadata(`value`: Output>) {
        this.metadata = value
    }

    /**
     * @param value The name (or path) of the File that should be created within this File Share. Changing this forces a new resource to be created.
     */
    @JvmName("fppewrvfhybeodlp")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The storage share directory that you would like the file placed into. Changing this forces a new resource to be created. Defaults to `""`.
     */
    @JvmName("cqcgwxctfhfkphih")
    public suspend fun path(`value`: Output) {
        this.path = value
    }

    /**
     * @param value An absolute path to a file on the local system. Changing this forces a new resource to be created.
     * > **Note** The file specified with `source` can not be empty.
     */
    @JvmName("jxrwoeldmkmuedaw")
    public suspend fun source(`value`: Output) {
        this.source = value
    }

    /**
     * @param value The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
     */
    @JvmName("jfvgkhnfxgaptivc")
    public suspend fun storageShareId(`value`: Output) {
        this.storageShareId = value
    }

    /**
     * @param value Sets the file’s Content-Disposition header.
     */
    @JvmName("squbbjnjytxdgsdo")
    public suspend fun contentDisposition(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.contentDisposition = mapped
    }

    /**
     * @param value Specifies which content encodings have been applied to the file.
     */
    @JvmName("wbrntilglsulrixv")
    public suspend fun contentEncoding(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.contentEncoding = mapped
    }

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

    /**
     * @param value The content type of the share file. Defaults to `application/octet-stream`.
     */
    @JvmName("vofaqcujpsputjaq")
    public suspend fun contentType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.contentType = mapped
    }

    /**
     * @param value A mapping of metadata to assign to this file.
     */
    @JvmName("mqbfjfurnvatqwoq")
    public suspend fun metadata(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metadata = mapped
    }

    /**
     * @param values A mapping of metadata to assign to this file.
     */
    @JvmName("ebmgfsxinrntlvxb")
    public fun metadata(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metadata = mapped
    }

    /**
     * @param value The name (or path) of the File that should be created within this File Share. Changing this forces a new resource to be created.
     */
    @JvmName("hfmwiewncgibbsju")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The storage share directory that you would like the file placed into. Changing this forces a new resource to be created. Defaults to `""`.
     */
    @JvmName("dlrbutjvsgrkrohu")
    public suspend fun path(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.path = mapped
    }

    /**
     * @param value An absolute path to a file on the local system. Changing this forces a new resource to be created.
     * > **Note** The file specified with `source` can not be empty.
     */
    @JvmName("qifgalbystpsmgfr")
    public suspend fun source(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.source = mapped
    }

    /**
     * @param value The Storage Share ID in which this file will be placed into. Changing this forces a new resource to be created.
     */
    @JvmName("cxymmmemhepcghad")
    public suspend fun storageShareId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.storageShareId = mapped
    }

    internal fun build(): ShareFileArgs = ShareFileArgs(
        contentDisposition = contentDisposition,
        contentEncoding = contentEncoding,
        contentMd5 = contentMd5,
        contentType = contentType,
        metadata = metadata,
        name = name,
        path = path,
        source = source,
        storageShareId = storageShareId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy