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

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

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

package com.pulumi.azure.datafactory.kotlin

import com.pulumi.azure.datafactory.DatasetHttpArgs.builder
import com.pulumi.azure.datafactory.kotlin.inputs.DatasetHttpSchemaColumnArgs
import com.pulumi.azure.datafactory.kotlin.inputs.DatasetHttpSchemaColumnArgsBuilder
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 an Azure HTTP Dataset inside an 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 exampleLinkedServiceWeb = new azure.datafactory.LinkedServiceWeb("example", {
 *     name: "example",
 *     dataFactoryId: exampleFactory.id,
 *     authenticationType: "Anonymous",
 *     url: "https://www.bing.com",
 * });
 * const exampleDatasetHttp = new azure.datafactory.DatasetHttp("example", {
 *     name: "example",
 *     dataFactoryId: exampleFactory.id,
 *     linkedServiceName: exampleLinkedServiceWeb.name,
 *     relativeUrl: "http://www.bing.com",
 *     requestBody: "foo=bar",
 *     requestMethod: "POST",
 * });
 * ```
 * ```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_web = azure.datafactory.LinkedServiceWeb("example",
 *     name="example",
 *     data_factory_id=example_factory.id,
 *     authentication_type="Anonymous",
 *     url="https://www.bing.com")
 * example_dataset_http = azure.datafactory.DatasetHttp("example",
 *     name="example",
 *     data_factory_id=example_factory.id,
 *     linked_service_name=example_linked_service_web.name,
 *     relative_url="http://www.bing.com",
 *     request_body="foo=bar",
 *     request_method="POST")
 * ```
 * ```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 exampleLinkedServiceWeb = new Azure.DataFactory.LinkedServiceWeb("example", new()
 *     {
 *         Name = "example",
 *         DataFactoryId = exampleFactory.Id,
 *         AuthenticationType = "Anonymous",
 *         Url = "https://www.bing.com",
 *     });
 *     var exampleDatasetHttp = new Azure.DataFactory.DatasetHttp("example", new()
 *     {
 *         Name = "example",
 *         DataFactoryId = exampleFactory.Id,
 *         LinkedServiceName = exampleLinkedServiceWeb.Name,
 *         RelativeUrl = "http://www.bing.com",
 *         RequestBody = "foo=bar",
 *         RequestMethod = "POST",
 *     });
 * });
 * ```
 * ```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
 * 		}
 * 		exampleLinkedServiceWeb, err := datafactory.NewLinkedServiceWeb(ctx, "example", &datafactory.LinkedServiceWebArgs{
 * 			Name:               pulumi.String("example"),
 * 			DataFactoryId:      exampleFactory.ID(),
 * 			AuthenticationType: pulumi.String("Anonymous"),
 * 			Url:                pulumi.String("https://www.bing.com"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = datafactory.NewDatasetHttp(ctx, "example", &datafactory.DatasetHttpArgs{
 * 			Name:              pulumi.String("example"),
 * 			DataFactoryId:     exampleFactory.ID(),
 * 			LinkedServiceName: exampleLinkedServiceWeb.Name,
 * 			RelativeUrl:       pulumi.String("http://www.bing.com"),
 * 			RequestBody:       pulumi.String("foo=bar"),
 * 			RequestMethod:     pulumi.String("POST"),
 * 		})
 * 		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.LinkedServiceWeb;
 * import com.pulumi.azure.datafactory.LinkedServiceWebArgs;
 * import com.pulumi.azure.datafactory.DatasetHttp;
 * import com.pulumi.azure.datafactory.DatasetHttpArgs;
 * 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 exampleLinkedServiceWeb = new LinkedServiceWeb("exampleLinkedServiceWeb", LinkedServiceWebArgs.builder()
 *             .name("example")
 *             .dataFactoryId(exampleFactory.id())
 *             .authenticationType("Anonymous")
 *             .url("https://www.bing.com")
 *             .build());
 *         var exampleDatasetHttp = new DatasetHttp("exampleDatasetHttp", DatasetHttpArgs.builder()
 *             .name("example")
 *             .dataFactoryId(exampleFactory.id())
 *             .linkedServiceName(exampleLinkedServiceWeb.name())
 *             .relativeUrl("http://www.bing.com")
 *             .requestBody("foo=bar")
 *             .requestMethod("POST")
 *             .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}
 *   exampleLinkedServiceWeb:
 *     type: azure:datafactory:LinkedServiceWeb
 *     name: example
 *     properties:
 *       name: example
 *       dataFactoryId: ${exampleFactory.id}
 *       authenticationType: Anonymous
 *       url: https://www.bing.com
 *   exampleDatasetHttp:
 *     type: azure:datafactory:DatasetHttp
 *     name: example
 *     properties:
 *       name: example
 *       dataFactoryId: ${exampleFactory.id}
 *       linkedServiceName: ${exampleLinkedServiceWeb.name}
 *       relativeUrl: http://www.bing.com
 *       requestBody: foo=bar
 *       requestMethod: POST
 * ```
 * 
 * ## Import
 * Data Factory Datasets can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:datafactory/datasetHttp:DatasetHttp 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.
 * The following supported arguments are specific to HTTP Dataset:
 * @property annotations List of tags that can be used for describing the Data Factory Dataset.
 * @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.
 * @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. 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.
 * @property relativeUrl The relative URL based on the URL in the HTTP Linked Service.
 * @property requestBody The body for the HTTP request.
 * @property requestMethod The HTTP method for the HTTP request. (e.g. GET, POST)
 * @property schemaColumns A `schema_column` block as defined below.
 */
public data class DatasetHttpArgs(
    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 relativeUrl: Output? = null,
    public val requestBody: Output? = null,
    public val requestMethod: Output? = null,
    public val schemaColumns: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.datafactory.DatasetHttpArgs =
        com.pulumi.azure.datafactory.DatasetHttpArgs.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()
                }),
            )
            .relativeUrl(relativeUrl?.applyValue({ args0 -> args0 }))
            .requestBody(requestBody?.applyValue({ args0 -> args0 }))
            .requestMethod(requestMethod?.applyValue({ args0 -> args0 }))
            .schemaColumns(
                schemaColumns?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [DatasetHttpArgs].
 */
@PulumiTagMarker
public class DatasetHttpArgsBuilder 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 relativeUrl: Output? = null

    private var requestBody: Output? = null

    private var requestMethod: Output? = null

    private var schemaColumns: Output>? = null

    /**
     * @param value A map of additional properties to associate with the Data Factory Dataset.
     * The following supported arguments are specific to HTTP Dataset:
     */
    @JvmName("qsvejnllbjsfrvjg")
    public suspend fun additionalProperties(`value`: Output>) {
        this.additionalProperties = value
    }

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

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

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

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

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

    /**
     * @param value The relative URL based on the URL in the HTTP Linked Service.
     */
    @JvmName("xdpdjxqpgvbtohho")
    public suspend fun relativeUrl(`value`: Output) {
        this.relativeUrl = value
    }

    /**
     * @param value The body for the HTTP request.
     */
    @JvmName("dvhifiryvjwydcjy")
    public suspend fun requestBody(`value`: Output) {
        this.requestBody = value
    }

    /**
     * @param value The HTTP method for the HTTP request. (e.g. GET, POST)
     */
    @JvmName("sequlevrqcrhlety")
    public suspend fun requestMethod(`value`: Output) {
        this.requestMethod = value
    }

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

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

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

    /**
     * @param value A map of additional properties to associate with the Data Factory Dataset.
     * The following supported arguments are specific to HTTP Dataset:
     */
    @JvmName("valdygypldbvvecx")
    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.
     * The following supported arguments are specific to HTTP Dataset:
     */
    @JvmName("guogxqnteewhiomh")
    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.
     */
    @JvmName("jxrspqtudxljmgov")
    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.
     */
    @JvmName("mvwtmvuyfdemtefh")
    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("lmorrpdtoksnsleu")
    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.
     */
    @JvmName("rtojjhlyuviwmrjk")
    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("kqogkaxnfbylxjio")
    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("fmtwcvecoyckubbe")
    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. 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("ntmsdhfkvggxulwt")
    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.
     */
    @JvmName("fxfniavqdtkgffga")
    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.
     */
    @JvmName("bxxaqpjvnlixutbe")
    public fun parameters(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.parameters = mapped
    }

    /**
     * @param value The relative URL based on the URL in the HTTP Linked Service.
     */
    @JvmName("jvvakdtqsgubaewr")
    public suspend fun relativeUrl(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.relativeUrl = mapped
    }

    /**
     * @param value The body for the HTTP request.
     */
    @JvmName("uilhwoxohdsuaetu")
    public suspend fun requestBody(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestBody = mapped
    }

    /**
     * @param value The HTTP method for the HTTP request. (e.g. GET, POST)
     */
    @JvmName("jwqmnsbmdqsekcbt")
    public suspend fun requestMethod(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestMethod = mapped
    }

    /**
     * @param value A `schema_column` block as defined below.
     */
    @JvmName("bruxaxnljbmlbxpv")
    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("dphanujeuenrrhyb")
    public suspend fun schemaColumns(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DatasetHttpSchemaColumnArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.schemaColumns = mapped
    }

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

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

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

    internal fun build(): DatasetHttpArgs = DatasetHttpArgs(
        additionalProperties = additionalProperties,
        annotations = annotations,
        dataFactoryId = dataFactoryId,
        description = description,
        folder = folder,
        linkedServiceName = linkedServiceName,
        name = name,
        parameters = parameters,
        relativeUrl = relativeUrl,
        requestBody = requestBody,
        requestMethod = requestMethod,
        schemaColumns = schemaColumns,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy