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

com.pulumi.azurenative.synapse.kotlin.IotHubDataConnection.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.synapse.kotlin

import com.pulumi.azurenative.synapse.kotlin.outputs.SystemDataResponse
import com.pulumi.azurenative.synapse.kotlin.outputs.SystemDataResponse.Companion.toKotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

/**
 * Builder for [IotHubDataConnection].
 */
@PulumiTagMarker
public class IotHubDataConnectionResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: IotHubDataConnectionArgs = IotHubDataConnectionArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend IotHubDataConnectionArgsBuilder.() -> Unit) {
        val builder = IotHubDataConnectionArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): IotHubDataConnection {
        val builtJavaResource =
            com.pulumi.azurenative.synapse.IotHubDataConnection(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return IotHubDataConnection(builtJavaResource)
    }
}

/**
 * Class representing an iot hub data connection.
 * Azure REST API version: 2021-06-01-preview.
 * ## Example Usage
 * ### KustoPoolDataConnectionsCreateOrUpdate.json
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var iotHubDataConnection = new AzureNative.Synapse.IotHubDataConnection("iotHubDataConnection", new()
 *     {
 *         DataConnectionName = "DataConnections8",
 *         DatabaseName = "KustoDatabase8",
 *         KustoPoolName = "kustoclusterrptest4",
 *         ResourceGroupName = "kustorptest",
 *         WorkspaceName = "synapseWorkspaceName",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	synapse "github.com/pulumi/pulumi-azure-native-sdk/synapse/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := synapse.NewIotHubDataConnection(ctx, "iotHubDataConnection", &synapse.IotHubDataConnectionArgs{
 * 			DataConnectionName: pulumi.String("DataConnections8"),
 * 			DatabaseName:       pulumi.String("KustoDatabase8"),
 * 			KustoPoolName:      pulumi.String("kustoclusterrptest4"),
 * 			ResourceGroupName:  pulumi.String("kustorptest"),
 * 			WorkspaceName:      pulumi.String("synapseWorkspaceName"),
 * 		})
 * 		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.synapse.IotHubDataConnection;
 * import com.pulumi.azurenative.synapse.IotHubDataConnectionArgs;
 * 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 iotHubDataConnection = new IotHubDataConnection("iotHubDataConnection", IotHubDataConnectionArgs.builder()
 *             .dataConnectionName("DataConnections8")
 *             .databaseName("KustoDatabase8")
 *             .kustoPoolName("kustoclusterrptest4")
 *             .resourceGroupName("kustorptest")
 *             .workspaceName("synapseWorkspaceName")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:synapse:IotHubDataConnection KustoClusterRPTest4/KustoDatabase8/DataConnections8 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/kustoPools/{kustoPoolName}/databases/{databaseName}/dataConnections/{dataConnectionName}
 * ```
 */
public class IotHubDataConnection internal constructor(
    override val javaResource: com.pulumi.azurenative.synapse.IotHubDataConnection,
) : KotlinCustomResource(javaResource, IotHubDataConnectionMapper) {
    /**
     * The iot hub consumer group.
     */
    public val consumerGroup: Output
        get() = javaResource.consumerGroup().applyValue({ args0 -> args0 })

    /**
     * The data format of the message. Optionally the data format can be added to each message.
     */
    public val dataFormat: Output?
        get() = javaResource.dataFormat().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * System properties of the iot hub
     */
    public val eventSystemProperties: Output>?
        get() = javaResource.eventSystemProperties().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * The resource ID of the Iot hub to be used to create a data connection.
     */
    public val iotHubResourceId: Output
        get() = javaResource.iotHubResourceId().applyValue({ args0 -> args0 })

    /**
     * Kind of the endpoint for the data connection
     * Expected value is 'IotHub'.
     */
    public val kind: Output
        get() = javaResource.kind().applyValue({ args0 -> args0 })

    /**
     * Resource location.
     */
    public val location: Output?
        get() = javaResource.location().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.
     */
    public val mappingRuleName: Output?
        get() = javaResource.mappingRuleName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The name of the resource
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The provisioned state of the resource.
     */
    public val provisioningState: Output
        get() = javaResource.provisioningState().applyValue({ args0 -> args0 })

    /**
     * The name of the share access policy
     */
    public val sharedAccessPolicyName: Output
        get() = javaResource.sharedAccessPolicyName().applyValue({ args0 -> args0 })

    /**
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    public val systemData: Output
        get() = javaResource.systemData().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })

    /**
     * The table where the data should be ingested. Optionally the table information can be added to each message.
     */
    public val tableName: Output?
        get() = javaResource.tableName().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })
}

public object IotHubDataConnectionMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azurenative.synapse.IotHubDataConnection::class == javaResource::class

    override fun map(javaResource: Resource): IotHubDataConnection = IotHubDataConnection(
        javaResource
            as com.pulumi.azurenative.synapse.IotHubDataConnection,
    )
}

/**
 * @see [IotHubDataConnection].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [IotHubDataConnection].
 */
public suspend fun iotHubDataConnection(
    name: String,
    block: suspend IotHubDataConnectionResourceBuilder.() -> Unit,
): IotHubDataConnection {
    val builder = IotHubDataConnectionResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [IotHubDataConnection].
 * @param name The _unique_ name of the resulting resource.
 */
public fun iotHubDataConnection(name: String): IotHubDataConnection {
    val builder = IotHubDataConnectionResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy