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

com.pulumi.azure.bot.kotlin.ConnectionArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.bot.kotlin

import com.pulumi.azure.bot.ConnectionArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Deprecated
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a Bot Connection.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const current = azure.core.getClientConfig({});
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleChannelsRegistration = new azure.bot.ChannelsRegistration("example", {
 *     name: "example",
 *     location: "global",
 *     resourceGroupName: example.name,
 *     sku: "F0",
 *     microsoftAppId: current.then(current => current.clientId),
 * });
 * const exampleConnection = new azure.bot.Connection("example", {
 *     name: "example",
 *     botName: exampleChannelsRegistration.name,
 *     location: exampleChannelsRegistration.location,
 *     resourceGroupName: example.name,
 *     serviceProviderName: "box",
 *     clientId: "exampleId",
 *     clientSecret: "exampleSecret",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * current = azure.core.get_client_config()
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_channels_registration = azure.bot.ChannelsRegistration("example",
 *     name="example",
 *     location="global",
 *     resource_group_name=example.name,
 *     sku="F0",
 *     microsoft_app_id=current.client_id)
 * example_connection = azure.bot.Connection("example",
 *     name="example",
 *     bot_name=example_channels_registration.name,
 *     location=example_channels_registration.location,
 *     resource_group_name=example.name,
 *     service_provider_name="box",
 *     client_id="exampleId",
 *     client_secret="exampleSecret")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var current = Azure.Core.GetClientConfig.Invoke();
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleChannelsRegistration = new Azure.Bot.ChannelsRegistration("example", new()
 *     {
 *         Name = "example",
 *         Location = "global",
 *         ResourceGroupName = example.Name,
 *         Sku = "F0",
 *         MicrosoftAppId = current.Apply(getClientConfigResult => getClientConfigResult.ClientId),
 *     });
 *     var exampleConnection = new Azure.Bot.Connection("example", new()
 *     {
 *         Name = "example",
 *         BotName = exampleChannelsRegistration.Name,
 *         Location = exampleChannelsRegistration.Location,
 *         ResourceGroupName = example.Name,
 *         ServiceProviderName = "box",
 *         ClientId = "exampleId",
 *         ClientSecret = "exampleSecret",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/bot"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		current, err := core.GetClientConfig(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleChannelsRegistration, err := bot.NewChannelsRegistration(ctx, "example", &bot.ChannelsRegistrationArgs{
 * 			Name:              pulumi.String("example"),
 * 			Location:          pulumi.String("global"),
 * 			ResourceGroupName: example.Name,
 * 			Sku:               pulumi.String("F0"),
 * 			MicrosoftAppId:    pulumi.String(current.ClientId),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = bot.NewConnection(ctx, "example", &bot.ConnectionArgs{
 * 			Name:                pulumi.String("example"),
 * 			BotName:             exampleChannelsRegistration.Name,
 * 			Location:            exampleChannelsRegistration.Location,
 * 			ResourceGroupName:   example.Name,
 * 			ServiceProviderName: pulumi.String("box"),
 * 			ClientId:            pulumi.String("exampleId"),
 * 			ClientSecret:        pulumi.String("exampleSecret"),
 * 		})
 * 		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.CoreFunctions;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.bot.ChannelsRegistration;
 * import com.pulumi.azure.bot.ChannelsRegistrationArgs;
 * import com.pulumi.azure.bot.Connection;
 * import com.pulumi.azure.bot.ConnectionArgs;
 * 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) {
 *         final var current = CoreFunctions.getClientConfig();
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleChannelsRegistration = new ChannelsRegistration("exampleChannelsRegistration", ChannelsRegistrationArgs.builder()
 *             .name("example")
 *             .location("global")
 *             .resourceGroupName(example.name())
 *             .sku("F0")
 *             .microsoftAppId(current.applyValue(getClientConfigResult -> getClientConfigResult.clientId()))
 *             .build());
 *         var exampleConnection = new Connection("exampleConnection", ConnectionArgs.builder()
 *             .name("example")
 *             .botName(exampleChannelsRegistration.name())
 *             .location(exampleChannelsRegistration.location())
 *             .resourceGroupName(example.name())
 *             .serviceProviderName("box")
 *             .clientId("exampleId")
 *             .clientSecret("exampleSecret")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleChannelsRegistration:
 *     type: azure:bot:ChannelsRegistration
 *     name: example
 *     properties:
 *       name: example
 *       location: global
 *       resourceGroupName: ${example.name}
 *       sku: F0
 *       microsoftAppId: ${current.clientId}
 *   exampleConnection:
 *     type: azure:bot:Connection
 *     name: example
 *     properties:
 *       name: example
 *       botName: ${exampleChannelsRegistration.name}
 *       location: ${exampleChannelsRegistration.location}
 *       resourceGroupName: ${example.name}
 *       serviceProviderName: box
 *       clientId: exampleId
 *       clientSecret: exampleSecret
 * variables:
 *   current:
 *     fn::invoke:
 *       Function: azure:core:getClientConfig
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Bot Connection can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:bot/connection:Connection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.BotService/botServices/example/connections/example
 * ```
 * @property botName The name of the Bot Resource this connection will be associated with. Changing this forces a new resource to be created.
 * @property clientId The Client ID that will be used to authenticate with the service provider.
 * @property clientSecret The Client Secret that will be used to authenticate with the service provider.
 * @property location The supported Azure location where the resource exists. Changing this forces a new resource to be created.
 * @property name Specifies the name of the Bot Connection. Changing this forces a new resource to be created. Must be globally unique.
 * @property parameters A map of additional parameters to apply to the connection.
 * @property resourceGroupName The name of the resource group in which to create the Bot Connection. Changing this forces a new resource to be created.
 * @property scopes The Scopes at which the connection should be applied.
 * @property serviceProviderName The name of the service provider that will be associated with this connection. Changing this forces a new resource to be created.
 * @property tags A mapping of tags to assign to the resource.
 * > **Note:** `tags` has been deprecated as the API no longer supports it and will be removed in version 4.0 of the provider.
 */
public data class ConnectionArgs(
    public val botName: Output? = null,
    public val clientId: Output? = null,
    public val clientSecret: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val parameters: Output>? = null,
    public val resourceGroupName: Output? = null,
    public val scopes: Output? = null,
    public val serviceProviderName: Output? = null,
    @Deprecated(
        message = """
  This property has been deprecated as the API no longer supports tags and will be removed in
      version 4.0 of the provider.
  """,
    )
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.bot.ConnectionArgs =
        com.pulumi.azure.bot.ConnectionArgs.builder()
            .botName(botName?.applyValue({ args0 -> args0 }))
            .clientId(clientId?.applyValue({ args0 -> args0 }))
            .clientSecret(clientSecret?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .parameters(
                parameters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .scopes(scopes?.applyValue({ args0 -> args0 }))
            .serviceProviderName(serviceProviderName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [ConnectionArgs].
 */
@PulumiTagMarker
public class ConnectionArgsBuilder internal constructor() {
    private var botName: Output? = null

    private var clientId: Output? = null

    private var clientSecret: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var parameters: Output>? = null

    private var resourceGroupName: Output? = null

    private var scopes: Output? = null

    private var serviceProviderName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The name of the Bot Resource this connection will be associated with. Changing this forces a new resource to be created.
     */
    @JvmName("dplpdxxaxotoafxj")
    public suspend fun botName(`value`: Output) {
        this.botName = value
    }

    /**
     * @param value The Client ID that will be used to authenticate with the service provider.
     */
    @JvmName("yeievpsfaysotuxc")
    public suspend fun clientId(`value`: Output) {
        this.clientId = value
    }

    /**
     * @param value The Client Secret that will be used to authenticate with the service provider.
     */
    @JvmName("jgetvxobqmnrkdfq")
    public suspend fun clientSecret(`value`: Output) {
        this.clientSecret = value
    }

    /**
     * @param value The supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("itkakjjhtyhbkfmn")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Specifies the name of the Bot Connection. Changing this forces a new resource to be created. Must be globally unique.
     */
    @JvmName("xgdmpfgllwwnkknw")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value A map of additional parameters to apply to the connection.
     */
    @JvmName("mlpgylxeumqnvopa")
    public suspend fun parameters(`value`: Output>) {
        this.parameters = value
    }

    /**
     * @param value The name of the resource group in which to create the Bot Connection. Changing this forces a new resource to be created.
     */
    @JvmName("oknxinyarvblminx")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The Scopes at which the connection should be applied.
     */
    @JvmName("oqrtopceequtbenh")
    public suspend fun scopes(`value`: Output) {
        this.scopes = value
    }

    /**
     * @param value The name of the service provider that will be associated with this connection. Changing this forces a new resource to be created.
     */
    @JvmName("nhdweskqqplkylqn")
    public suspend fun serviceProviderName(`value`: Output) {
        this.serviceProviderName = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     * > **Note:** `tags` has been deprecated as the API no longer supports it and will be removed in version 4.0 of the provider.
     */
    @Deprecated(
        message = """
  This property has been deprecated as the API no longer supports tags and will be removed in
      version 4.0 of the provider.
  """,
    )
    @JvmName("dojgeomhpqcgnrvf")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The name of the Bot Resource this connection will be associated with. Changing this forces a new resource to be created.
     */
    @JvmName("hnrcdbebhxsgvkao")
    public suspend fun botName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.botName = mapped
    }

    /**
     * @param value The Client ID that will be used to authenticate with the service provider.
     */
    @JvmName("kqvxnmbkgplonqjq")
    public suspend fun clientId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clientId = mapped
    }

    /**
     * @param value The Client Secret that will be used to authenticate with the service provider.
     */
    @JvmName("rwofcofmmmalcphf")
    public suspend fun clientSecret(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clientSecret = mapped
    }

    /**
     * @param value The supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("kkobkiclejmyosoj")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Specifies the name of the Bot Connection. Changing this forces a new resource to be created. Must be globally unique.
     */
    @JvmName("bjhpeqxmbigvuigd")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value A map of additional parameters to apply to the connection.
     */
    @JvmName("xgrwkamkdhebxxqy")
    public suspend fun parameters(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parameters = mapped
    }

    /**
     * @param values A map of additional parameters to apply to the connection.
     */
    @JvmName("bbtcdlohnkcinefm")
    public fun parameters(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.parameters = mapped
    }

    /**
     * @param value The name of the resource group in which to create the Bot Connection. Changing this forces a new resource to be created.
     */
    @JvmName("pqaovlmkuajsslem")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The Scopes at which the connection should be applied.
     */
    @JvmName("qxvphidaibjxdpfl")
    public suspend fun scopes(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scopes = mapped
    }

    /**
     * @param value The name of the service provider that will be associated with this connection. Changing this forces a new resource to be created.
     */
    @JvmName("yscmnmaxtwfvfvjw")
    public suspend fun serviceProviderName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serviceProviderName = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     * > **Note:** `tags` has been deprecated as the API no longer supports it and will be removed in version 4.0 of the provider.
     */
    @Deprecated(
        message = """
  This property has been deprecated as the API no longer supports tags and will be removed in
      version 4.0 of the provider.
  """,
    )
    @JvmName("pfaebetjxqaupnpn")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource.
     * > **Note:** `tags` has been deprecated as the API no longer supports it and will be removed in version 4.0 of the provider.
     */
    @Deprecated(
        message = """
  This property has been deprecated as the API no longer supports tags and will be removed in
      version 4.0 of the provider.
  """,
    )
    @JvmName("pwiqxfriinylgdxd")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): ConnectionArgs = ConnectionArgs(
        botName = botName,
        clientId = clientId,
        clientSecret = clientSecret,
        location = location,
        name = name,
        parameters = parameters,
        resourceGroupName = resourceGroupName,
        scopes = scopes,
        serviceProviderName = serviceProviderName,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy