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

com.pulumi.azure.datafactory.kotlin.DatasetPostgresqlArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.datafactory.kotlin

import com.pulumi.azure.datafactory.DatasetPostgresqlArgs.builder
import com.pulumi.azure.datafactory.kotlin.inputs.DatasetPostgresqlSchemaColumnArgs
import com.pulumi.azure.datafactory.kotlin.inputs.DatasetPostgresqlSchemaColumnArgsBuilder
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.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a PostgreSQL Dataset inside a Azure Data Factory.
 * ## 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 exampleFactory = new azure.datafactory.Factory("example", {
 *     name: "example",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleLinkedServicePostgresql = new azure.datafactory.LinkedServicePostgresql("example", {
 *     name: "example",
 *     dataFactoryId: exampleFactory.id,
 *     connectionString: "Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example",
 * });
 * const exampleDatasetPostgresql = new azure.datafactory.DatasetPostgresql("example", {
 *     name: "example",
 *     dataFactoryId: exampleFactory.id,
 *     linkedServiceName: exampleLinkedServicePostgresql.name,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_factory = azure.datafactory.Factory("example",
 *     name="example",
 *     location=example.location,
 *     resource_group_name=example.name)
 * example_linked_service_postgresql = azure.datafactory.LinkedServicePostgresql("example",
 *     name="example",
 *     data_factory_id=example_factory.id,
 *     connection_string="Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example")
 * example_dataset_postgresql = azure.datafactory.DatasetPostgresql("example",
 *     name="example",
 *     data_factory_id=example_factory.id,
 *     linked_service_name=example_linked_service_postgresql.name)
 * ```
 * ```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 exampleFactory = new Azure.DataFactory.Factory("example", new()
 *     {
 *         Name = "example",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *     });
 *     var exampleLinkedServicePostgresql = new Azure.DataFactory.LinkedServicePostgresql("example", new()
 *     {
 *         Name = "example",
 *         DataFactoryId = exampleFactory.Id,
 *         ConnectionString = "Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example",
 *     });
 *     var exampleDatasetPostgresql = new Azure.DataFactory.DatasetPostgresql("example", new()
 *     {
 *         Name = "example",
 *         DataFactoryId = exampleFactory.Id,
 *         LinkedServiceName = exampleLinkedServicePostgresql.Name,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/datafactory"
 * 	"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
 * 		}
 * 		exampleFactory, err := datafactory.NewFactory(ctx, "example", &datafactory.FactoryArgs{
 * 			Name:              pulumi.String("example"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleLinkedServicePostgresql, err := datafactory.NewLinkedServicePostgresql(ctx, "example", &datafactory.LinkedServicePostgresqlArgs{
 * 			Name:             pulumi.String("example"),
 * 			DataFactoryId:    exampleFactory.ID(),
 * 			ConnectionString: pulumi.String("Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = datafactory.NewDatasetPostgresql(ctx, "example", &datafactory.DatasetPostgresqlArgs{
 * 			Name:              pulumi.String("example"),
 * 			DataFactoryId:     exampleFactory.ID(),
 * 			LinkedServiceName: exampleLinkedServicePostgresql.Name,
 * 		})
 * 		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.datafactory.Factory;
 * import com.pulumi.azure.datafactory.FactoryArgs;
 * import com.pulumi.azure.datafactory.LinkedServicePostgresql;
 * import com.pulumi.azure.datafactory.LinkedServicePostgresqlArgs;
 * import com.pulumi.azure.datafactory.DatasetPostgresql;
 * import com.pulumi.azure.datafactory.DatasetPostgresqlArgs;
 * 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 exampleFactory = new Factory("exampleFactory", FactoryArgs.builder()
 *             .name("example")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 *         var exampleLinkedServicePostgresql = new LinkedServicePostgresql("exampleLinkedServicePostgresql", LinkedServicePostgresqlArgs.builder()
 *             .name("example")
 *             .dataFactoryId(exampleFactory.id())
 *             .connectionString("Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example")
 *             .build());
 *         var exampleDatasetPostgresql = new DatasetPostgresql("exampleDatasetPostgresql", DatasetPostgresqlArgs.builder()
 *             .name("example")
 *             .dataFactoryId(exampleFactory.id())
 *             .linkedServiceName(exampleLinkedServicePostgresql.name())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleFactory:
 *     type: azure:datafactory:Factory
 *     name: example
 *     properties:
 *       name: example
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *   exampleLinkedServicePostgresql:
 *     type: azure:datafactory:LinkedServicePostgresql
 *     name: example
 *     properties:
 *       name: example
 *       dataFactoryId: ${exampleFactory.id}
 *       connectionString: Host=example;Port=5432;Database=example;UID=example;EncryptionMethod=0;Password=example
 *   exampleDatasetPostgresql:
 *     type: azure:datafactory:DatasetPostgresql
 *     name: example
 *     properties:
 *       name: example
 *       dataFactoryId: ${exampleFactory.id}
 *       linkedServiceName: ${exampleLinkedServicePostgresql.name}
 * ```
 * 
 * ## Import
 * Data Factory PostgreSQL Datasets can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:datafactory/datasetPostgresql:DatasetPostgresql example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.DataFactory/factories/example/datasets/example
 * ```
 * @property additionalProperties A map of additional properties to associate with the Data Factory Dataset PostgreSQL.
 * @property annotations List of tags that can be used for describing the Data Factory Dataset PostgreSQL.
 * @property dataFactoryId The Data Factory ID in which to associate the Linked Service with. Changing this forces a new resource.
 * @property description The description for the Data Factory Dataset PostgreSQL.
 * @property folder The folder that this Dataset is in. If not specified, the Dataset will appear at the root level.
 * @property linkedServiceName The Data Factory Linked Service name in which to associate the Dataset with.
 * @property name Specifies the name of the Data Factory Dataset PostgreSQL. Changing this forces a new resource to be created. Must be globally unique. See the [Microsoft documentation](https://docs.microsoft.com/azure/data-factory/naming-rules) for all restrictions.
 * @property parameters A map of parameters to associate with the Data Factory Dataset PostgreSQL.
 * @property schemaColumns A `schema_column` block as defined below.
 * @property tableName The table name of the Data Factory Dataset PostgreSQL.
 */
public data class DatasetPostgresqlArgs(
    public val additionalProperties: Output>? = null,
    public val annotations: Output>? = null,
    public val dataFactoryId: Output? = null,
    public val description: Output? = null,
    public val folder: Output? = null,
    public val linkedServiceName: Output? = null,
    public val name: Output? = null,
    public val parameters: Output>? = null,
    public val schemaColumns: Output>? = null,
    public val tableName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.datafactory.DatasetPostgresqlArgs =
        com.pulumi.azure.datafactory.DatasetPostgresqlArgs.builder()
            .additionalProperties(
                additionalProperties?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .annotations(annotations?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .dataFactoryId(dataFactoryId?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .folder(folder?.applyValue({ args0 -> args0 }))
            .linkedServiceName(linkedServiceName?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .parameters(
                parameters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .schemaColumns(
                schemaColumns?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .tableName(tableName?.applyValue({ args0 -> args0 })).build()
}

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

    private var annotations: Output>? = null

    private var dataFactoryId: Output? = null

    private var description: Output? = null

    private var folder: Output? = null

    private var linkedServiceName: Output? = null

    private var name: Output? = null

    private var parameters: Output>? = null

    private var schemaColumns: Output>? = null

    private var tableName: Output? = null

    /**
     * @param value A map of additional properties to associate with the Data Factory Dataset PostgreSQL.
     */
    @JvmName("simnxsdghpcgddsi")
    public suspend fun additionalProperties(`value`: Output>) {
        this.additionalProperties = value
    }

    /**
     * @param value List of tags that can be used for describing the Data Factory Dataset PostgreSQL.
     */
    @JvmName("cvshbdknvoivnqbf")
    public suspend fun annotations(`value`: Output>) {
        this.annotations = value
    }

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

    /**
     * @param values List of tags that can be used for describing the Data Factory Dataset PostgreSQL.
     */
    @JvmName("sukdynsltvrqnwie")
    public suspend fun annotations(values: List>) {
        this.annotations = Output.all(values)
    }

    /**
     * @param value The Data Factory ID in which to associate the Linked Service with. Changing this forces a new resource.
     */
    @JvmName("hcrrariksvxtgikp")
    public suspend fun dataFactoryId(`value`: Output) {
        this.dataFactoryId = value
    }

    /**
     * @param value The description for the Data Factory Dataset PostgreSQL.
     */
    @JvmName("vcjbpxkxkdlfrvsd")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The folder that this Dataset is in. If not specified, the Dataset will appear at the root level.
     */
    @JvmName("xecqpierymcgtfcg")
    public suspend fun folder(`value`: Output) {
        this.folder = value
    }

    /**
     * @param value The Data Factory Linked Service name in which to associate the Dataset with.
     */
    @JvmName("bstumkvsuynljkkt")
    public suspend fun linkedServiceName(`value`: Output) {
        this.linkedServiceName = value
    }

    /**
     * @param value Specifies the name of the Data Factory Dataset PostgreSQL. Changing this forces a new resource to be created. Must be globally unique. See the [Microsoft documentation](https://docs.microsoft.com/azure/data-factory/naming-rules) for all restrictions.
     */
    @JvmName("bvolfscinhyayeba")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value A map of parameters to associate with the Data Factory Dataset PostgreSQL.
     */
    @JvmName("bpggxiguhnysuslh")
    public suspend fun parameters(`value`: Output>) {
        this.parameters = value
    }

    /**
     * @param value A `schema_column` block as defined below.
     */
    @JvmName("yafrmwdurkmkyewj")
    public suspend fun schemaColumns(`value`: Output>) {
        this.schemaColumns = value
    }

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

    /**
     * @param values A `schema_column` block as defined below.
     */
    @JvmName("txvtcpbwtirnadqe")
    public suspend fun schemaColumns(values: List>) {
        this.schemaColumns = Output.all(values)
    }

    /**
     * @param value The table name of the Data Factory Dataset PostgreSQL.
     */
    @JvmName("dqcoxwhgvdypjgdi")
    public suspend fun tableName(`value`: Output) {
        this.tableName = value
    }

    /**
     * @param value A map of additional properties to associate with the Data Factory Dataset PostgreSQL.
     */
    @JvmName("ietcxqxulpncjcdu")
    public suspend fun additionalProperties(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.additionalProperties = mapped
    }

    /**
     * @param values A map of additional properties to associate with the Data Factory Dataset PostgreSQL.
     */
    @JvmName("yluddscdqqabnqhi")
    public fun additionalProperties(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.additionalProperties = mapped
    }

    /**
     * @param value List of tags that can be used for describing the Data Factory Dataset PostgreSQL.
     */
    @JvmName("drjvcyudtivjrsor")
    public suspend fun annotations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.annotations = mapped
    }

    /**
     * @param values List of tags that can be used for describing the Data Factory Dataset PostgreSQL.
     */
    @JvmName("mcogylddcopioslr")
    public suspend fun annotations(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.annotations = mapped
    }

    /**
     * @param value The Data Factory ID in which to associate the Linked Service with. Changing this forces a new resource.
     */
    @JvmName("mneicixqlktibfaj")
    public suspend fun dataFactoryId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dataFactoryId = mapped
    }

    /**
     * @param value The description for the Data Factory Dataset PostgreSQL.
     */
    @JvmName("bjkbyhsepthqwnls")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The folder that this Dataset is in. If not specified, the Dataset will appear at the root level.
     */
    @JvmName("dkvvqlracolriigr")
    public suspend fun folder(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.folder = mapped
    }

    /**
     * @param value The Data Factory Linked Service name in which to associate the Dataset with.
     */
    @JvmName("lpyesugylnbmfmrv")
    public suspend fun linkedServiceName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.linkedServiceName = mapped
    }

    /**
     * @param value Specifies the name of the Data Factory Dataset PostgreSQL. Changing this forces a new resource to be created. Must be globally unique. See the [Microsoft documentation](https://docs.microsoft.com/azure/data-factory/naming-rules) for all restrictions.
     */
    @JvmName("xhddaqcncgoxdhht")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value A map of parameters to associate with the Data Factory Dataset PostgreSQL.
     */
    @JvmName("hlqfbputubgqhakv")
    public suspend fun parameters(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parameters = mapped
    }

    /**
     * @param values A map of parameters to associate with the Data Factory Dataset PostgreSQL.
     */
    @JvmName("ldtyxnqclmlfbcmi")
    public fun parameters(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.parameters = mapped
    }

    /**
     * @param value A `schema_column` block as defined below.
     */
    @JvmName("ffwwujwvmaxiaujt")
    public suspend fun schemaColumns(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.schemaColumns = mapped
    }

    /**
     * @param argument A `schema_column` block as defined below.
     */
    @JvmName("flhtcntdfwnatlet")
    public suspend fun schemaColumns(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DatasetPostgresqlSchemaColumnArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.schemaColumns = mapped
    }

    /**
     * @param argument A `schema_column` block as defined below.
     */
    @JvmName("glxndhlokmdrwtue")
    public suspend fun schemaColumns(vararg argument: suspend DatasetPostgresqlSchemaColumnArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            DatasetPostgresqlSchemaColumnArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.schemaColumns = mapped
    }

    /**
     * @param argument A `schema_column` block as defined below.
     */
    @JvmName("fwnduvccvbnrfgmh")
    public suspend fun schemaColumns(argument: suspend DatasetPostgresqlSchemaColumnArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            DatasetPostgresqlSchemaColumnArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.schemaColumns = mapped
    }

    /**
     * @param values A `schema_column` block as defined below.
     */
    @JvmName("udxqrbhhnnueiqnp")
    public suspend fun schemaColumns(vararg values: DatasetPostgresqlSchemaColumnArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.schemaColumns = mapped
    }

    /**
     * @param value The table name of the Data Factory Dataset PostgreSQL.
     */
    @JvmName("hkjlyshhtdxilxlk")
    public suspend fun tableName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tableName = mapped
    }

    internal fun build(): DatasetPostgresqlArgs = DatasetPostgresqlArgs(
        additionalProperties = additionalProperties,
        annotations = annotations,
        dataFactoryId = dataFactoryId,
        description = description,
        folder = folder,
        linkedServiceName = linkedServiceName,
        name = name,
        parameters = parameters,
        schemaColumns = schemaColumns,
        tableName = tableName,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy