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

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

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.bot.kotlin

import com.pulumi.azure.bot.ChannelSlackArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages a Slack integration for a Bot Channel
 * > **Note** A bot can only have a single Slack Channel associated with it.
 * ## 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 exampleChannelSlack = new azure.bot.ChannelSlack("example", {
 *     botName: exampleChannelsRegistration.name,
 *     location: exampleChannelsRegistration.location,
 *     resourceGroupName: example.name,
 *     clientId: "exampleId",
 *     clientSecret: "exampleSecret",
 *     verificationToken: "exampleVerificationToken",
 * });
 * ```
 * ```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_channel_slack = azure.bot.ChannelSlack("example",
 *     bot_name=example_channels_registration.name,
 *     location=example_channels_registration.location,
 *     resource_group_name=example.name,
 *     client_id="exampleId",
 *     client_secret="exampleSecret",
 *     verification_token="exampleVerificationToken")
 * ```
 * ```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 exampleChannelSlack = new Azure.Bot.ChannelSlack("example", new()
 *     {
 *         BotName = exampleChannelsRegistration.Name,
 *         Location = exampleChannelsRegistration.Location,
 *         ResourceGroupName = example.Name,
 *         ClientId = "exampleId",
 *         ClientSecret = "exampleSecret",
 *         VerificationToken = "exampleVerificationToken",
 *     });
 * });
 * ```
 * ```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.NewChannelSlack(ctx, "example", &bot.ChannelSlackArgs{
 * 			BotName:           exampleChannelsRegistration.Name,
 * 			Location:          exampleChannelsRegistration.Location,
 * 			ResourceGroupName: example.Name,
 * 			ClientId:          pulumi.String("exampleId"),
 * 			ClientSecret:      pulumi.String("exampleSecret"),
 * 			VerificationToken: pulumi.String("exampleVerificationToken"),
 * 		})
 * 		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.ChannelSlack;
 * import com.pulumi.azure.bot.ChannelSlackArgs;
 * 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 exampleChannelSlack = new ChannelSlack("exampleChannelSlack", ChannelSlackArgs.builder()
 *             .botName(exampleChannelsRegistration.name())
 *             .location(exampleChannelsRegistration.location())
 *             .resourceGroupName(example.name())
 *             .clientId("exampleId")
 *             .clientSecret("exampleSecret")
 *             .verificationToken("exampleVerificationToken")
 *             .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}
 *   exampleChannelSlack:
 *     type: azure:bot:ChannelSlack
 *     name: example
 *     properties:
 *       botName: ${exampleChannelsRegistration.name}
 *       location: ${exampleChannelsRegistration.location}
 *       resourceGroupName: ${example.name}
 *       clientId: exampleId
 *       clientSecret: exampleSecret
 *       verificationToken: exampleVerificationToken
 * variables:
 *   current:
 *     fn::invoke:
 *       Function: azure:core:getClientConfig
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * The Slack Integration for a Bot Channel can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:bot/channelSlack:ChannelSlack example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.BotService/botServices/example/channels/SlackChannel
 * ```
 * @property botName The name of the Bot Resource this channel 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 Slack.
 * @property clientSecret The Client Secret that will be used to authenticate with Slack.
 * @property landingPageUrl The Slack Landing Page URL.
 * @property location The supported Azure location where the resource exists. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the resource group in which to create the Bot Channel. Changing this forces a new resource to be created.
 * @property signingSecret The Signing Secret that will be used to sign the requests.
 * @property verificationToken The Verification Token that will be used to authenticate with Slack.
 */
public data class ChannelSlackArgs(
    public val botName: Output? = null,
    public val clientId: Output? = null,
    public val clientSecret: Output? = null,
    public val landingPageUrl: Output? = null,
    public val location: Output? = null,
    public val resourceGroupName: Output? = null,
    public val signingSecret: Output? = null,
    public val verificationToken: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.bot.ChannelSlackArgs =
        com.pulumi.azure.bot.ChannelSlackArgs.builder()
            .botName(botName?.applyValue({ args0 -> args0 }))
            .clientId(clientId?.applyValue({ args0 -> args0 }))
            .clientSecret(clientSecret?.applyValue({ args0 -> args0 }))
            .landingPageUrl(landingPageUrl?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .signingSecret(signingSecret?.applyValue({ args0 -> args0 }))
            .verificationToken(verificationToken?.applyValue({ args0 -> args0 })).build()
}

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

    private var clientId: Output? = null

    private var clientSecret: Output? = null

    private var landingPageUrl: Output? = null

    private var location: Output? = null

    private var resourceGroupName: Output? = null

    private var signingSecret: Output? = null

    private var verificationToken: Output? = null

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

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

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

    /**
     * @param value The Slack Landing Page URL.
     */
    @JvmName("rxldnyimquginnhy")
    public suspend fun landingPageUrl(`value`: Output) {
        this.landingPageUrl = value
    }

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

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

    /**
     * @param value The Signing Secret that will be used to sign the requests.
     */
    @JvmName("odhsiedixgswrogq")
    public suspend fun signingSecret(`value`: Output) {
        this.signingSecret = value
    }

    /**
     * @param value The Verification Token that will be used to authenticate with Slack.
     */
    @JvmName("mwdsjqcrcxhhfxck")
    public suspend fun verificationToken(`value`: Output) {
        this.verificationToken = value
    }

    /**
     * @param value The name of the Bot Resource this channel will be associated with. Changing this forces a new resource to be created.
     */
    @JvmName("utasgflxnlgcqscu")
    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 Slack.
     */
    @JvmName("tlvuakbukicawtta")
    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 Slack.
     */
    @JvmName("nekesirmpfgdggae")
    public suspend fun clientSecret(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clientSecret = mapped
    }

    /**
     * @param value The Slack Landing Page URL.
     */
    @JvmName("ytyllyxjnvfpchng")
    public suspend fun landingPageUrl(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.landingPageUrl = mapped
    }

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

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

    /**
     * @param value The Signing Secret that will be used to sign the requests.
     */
    @JvmName("gqfrtsgkditkdmqc")
    public suspend fun signingSecret(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.signingSecret = mapped
    }

    /**
     * @param value The Verification Token that will be used to authenticate with Slack.
     */
    @JvmName("ptccheuhwmfgiygr")
    public suspend fun verificationToken(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.verificationToken = mapped
    }

    internal fun build(): ChannelSlackArgs = ChannelSlackArgs(
        botName = botName,
        clientId = clientId,
        clientSecret = clientSecret,
        landingPageUrl = landingPageUrl,
        location = location,
        resourceGroupName = resourceGroupName,
        signingSecret = signingSecret,
        verificationToken = verificationToken,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy