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

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

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

package com.pulumi.azure.datafactory.kotlin

import com.pulumi.azure.datafactory.DatasetMysqlArgs.builder
import com.pulumi.azure.datafactory.kotlin.inputs.DatasetMysqlSchemaColumnArgs
import com.pulumi.azure.datafactory.kotlin.inputs.DatasetMysqlSchemaColumnArgsBuilder
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 MySQL 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 exampleLinkedServiceMysql = new azure.datafactory.LinkedServiceMysql("example", {
 *     name: "example",
 *     dataFactoryId: exampleFactory.id,
 *     connectionString: "Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test",
 * });
 * const exampleDatasetMysql = new azure.datafactory.DatasetMysql("example", {
 *     name: "example",
 *     dataFactoryId: exampleFactory.id,
 *     linkedServiceName: exampleLinkedServiceMysql.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_mysql = azure.datafactory.LinkedServiceMysql("example",
 *     name="example",
 *     data_factory_id=example_factory.id,
 *     connection_string="Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test")
 * example_dataset_mysql = azure.datafactory.DatasetMysql("example",
 *     name="example",
 *     data_factory_id=example_factory.id,
 *     linked_service_name=example_linked_service_mysql.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 exampleLinkedServiceMysql = new Azure.DataFactory.LinkedServiceMysql("example", new()
 *     {
 *         Name = "example",
 *         DataFactoryId = exampleFactory.Id,
 *         ConnectionString = "Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test",
 *     });
 *     var exampleDatasetMysql = new Azure.DataFactory.DatasetMysql("example", new()
 *     {
 *         Name = "example",
 *         DataFactoryId = exampleFactory.Id,
 *         LinkedServiceName = exampleLinkedServiceMysql.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
 * 		}
 * 		exampleLinkedServiceMysql, err := datafactory.NewLinkedServiceMysql(ctx, "example", &datafactory.LinkedServiceMysqlArgs{
 * 			Name:             pulumi.String("example"),
 * 			DataFactoryId:    exampleFactory.ID(),
 * 			ConnectionString: pulumi.String("Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = datafactory.NewDatasetMysql(ctx, "example", &datafactory.DatasetMysqlArgs{
 * 			Name:              pulumi.String("example"),
 * 			DataFactoryId:     exampleFactory.ID(),
 * 			LinkedServiceName: exampleLinkedServiceMysql.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.LinkedServiceMysql;
 * import com.pulumi.azure.datafactory.LinkedServiceMysqlArgs;
 * import com.pulumi.azure.datafactory.DatasetMysql;
 * import com.pulumi.azure.datafactory.DatasetMysqlArgs;
 * 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 exampleLinkedServiceMysql = new LinkedServiceMysql("exampleLinkedServiceMysql", LinkedServiceMysqlArgs.builder()
 *             .name("example")
 *             .dataFactoryId(exampleFactory.id())
 *             .connectionString("Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test")
 *             .build());
 *         var exampleDatasetMysql = new DatasetMysql("exampleDatasetMysql", DatasetMysqlArgs.builder()
 *             .name("example")
 *             .dataFactoryId(exampleFactory.id())
 *             .linkedServiceName(exampleLinkedServiceMysql.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}
 *   exampleLinkedServiceMysql:
 *     type: azure:datafactory:LinkedServiceMysql
 *     name: example
 *     properties:
 *       name: example
 *       dataFactoryId: ${exampleFactory.id}
 *       connectionString: Server=test;Port=3306;Database=test;User=test;SSLMode=1;UseSystemTrustStore=0;Password=test
 *   exampleDatasetMysql:
 *     type: azure:datafactory:DatasetMysql
 *     name: example
 *     properties:
 *       name: example
 *       dataFactoryId: ${exampleFactory.id}
 *       linkedServiceName: ${exampleLinkedServiceMysql.name}
 * ```
 * 
 * ## Import
 * Data Factory MySQL Datasets can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:datafactory/datasetMysql:DatasetMysql 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 MySQL.
 * The following supported arguments are specific to MySQL Dataset:
 * @property annotations List of tags that can be used for describing the Data Factory Dataset MySQL.
 * @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 MySQL.
 * @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 MySQL. 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 MySQL.
 * @property schemaColumns A `schema_column` block as defined below.
 * @property tableName The table name of the Data Factory Dataset MySQL.
 */
public data class DatasetMysqlArgs(
    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.DatasetMysqlArgs =
        com.pulumi.azure.datafactory.DatasetMysqlArgs.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 [DatasetMysqlArgs].
 */
@PulumiTagMarker
public class DatasetMysqlArgsBuilder 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 MySQL.
     * The following supported arguments are specific to MySQL Dataset:
     */
    @JvmName("dypqjxvwnkwfrxoa")
    public suspend fun additionalProperties(`value`: Output>) {
        this.additionalProperties = value
    }

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

    @JvmName("ghvktkslwcdsdcvo")
    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 MySQL.
     */
    @JvmName("vjpplolaswcplwsv")
    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("uxoosfmdflfbjftj")
    public suspend fun dataFactoryId(`value`: Output) {
        this.dataFactoryId = value
    }

    /**
     * @param value The description for the Data Factory Dataset MySQL.
     */
    @JvmName("yerggaeoxajoeaiv")
    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("vejpwkvjfvxvcwra")
    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("nylkhlxfhqrxgvvf")
    public suspend fun linkedServiceName(`value`: Output) {
        this.linkedServiceName = value
    }

    /**
     * @param value Specifies the name of the Data Factory Dataset MySQL. 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("alfvfliqikcolxqj")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

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

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

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

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

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

    /**
     * @param value A map of additional properties to associate with the Data Factory Dataset MySQL.
     * The following supported arguments are specific to MySQL Dataset:
     */
    @JvmName("cviiicrhcvrtkdpi")
    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 MySQL.
     * The following supported arguments are specific to MySQL Dataset:
     */
    @JvmName("uyswjpoblvtbqmdr")
    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 MySQL.
     */
    @JvmName("qjslciqawnilevai")
    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 MySQL.
     */
    @JvmName("lcekrpfcrieqjtly")
    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("iiqboglrmupwpjxh")
    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 MySQL.
     */
    @JvmName("jjavxqaurbkbaxxj")
    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("tptwjaxuaiipxmfd")
    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("ajeclsnfggbikunw")
    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 MySQL. 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("illvfwjvvtliufpu")
    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 MySQL.
     */
    @JvmName("jouhfqkfcrpuqosg")
    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 MySQL.
     */
    @JvmName("xqlqivhkbrbrbmbt")
    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("qispgtaygkcojwpb")
    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("uarfsixaqhxucphl")
    public suspend fun schemaColumns(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DatasetMysqlSchemaColumnArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.schemaColumns = mapped
    }

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

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

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

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

    internal fun build(): DatasetMysqlArgs = DatasetMysqlArgs(
        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