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

com.pulumi.azure.logicapps.kotlin.ActionHttpArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.logicapps.kotlin

import com.pulumi.azure.logicapps.ActionHttpArgs.builder
import com.pulumi.azure.logicapps.kotlin.inputs.ActionHttpRunAfterArgs
import com.pulumi.azure.logicapps.kotlin.inputs.ActionHttpRunAfterArgsBuilder
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 HTTP Action within a Logic App Workflow
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "workflow-resources",
 *     location: "West Europe",
 * });
 * const exampleWorkflow = new azure.logicapps.Workflow("example", {
 *     name: "workflow1",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleActionHttp = new azure.logicapps.ActionHttp("example", {
 *     name: "webhook",
 *     logicAppId: exampleWorkflow.id,
 *     method: "GET",
 *     uri: "http://example.com/some-webhook",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="workflow-resources",
 *     location="West Europe")
 * example_workflow = azure.logicapps.Workflow("example",
 *     name="workflow1",
 *     location=example.location,
 *     resource_group_name=example.name)
 * example_action_http = azure.logicapps.ActionHttp("example",
 *     name="webhook",
 *     logic_app_id=example_workflow.id,
 *     method="GET",
 *     uri="http://example.com/some-webhook")
 * ```
 * ```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 = "workflow-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleWorkflow = new Azure.LogicApps.Workflow("example", new()
 *     {
 *         Name = "workflow1",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *     });
 *     var exampleActionHttp = new Azure.LogicApps.ActionHttp("example", new()
 *     {
 *         Name = "webhook",
 *         LogicAppId = exampleWorkflow.Id,
 *         Method = "GET",
 *         Uri = "http://example.com/some-webhook",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/logicapps"
 * 	"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("workflow-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleWorkflow, err := logicapps.NewWorkflow(ctx, "example", &logicapps.WorkflowArgs{
 * 			Name:              pulumi.String("workflow1"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = logicapps.NewActionHttp(ctx, "example", &logicapps.ActionHttpArgs{
 * 			Name:       pulumi.String("webhook"),
 * 			LogicAppId: exampleWorkflow.ID(),
 * 			Method:     pulumi.String("GET"),
 * 			Uri:        pulumi.String("http://example.com/some-webhook"),
 * 		})
 * 		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.logicapps.Workflow;
 * import com.pulumi.azure.logicapps.WorkflowArgs;
 * import com.pulumi.azure.logicapps.ActionHttp;
 * import com.pulumi.azure.logicapps.ActionHttpArgs;
 * 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("workflow-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleWorkflow = new Workflow("exampleWorkflow", WorkflowArgs.builder()
 *             .name("workflow1")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 *         var exampleActionHttp = new ActionHttp("exampleActionHttp", ActionHttpArgs.builder()
 *             .name("webhook")
 *             .logicAppId(exampleWorkflow.id())
 *             .method("GET")
 *             .uri("http://example.com/some-webhook")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: workflow-resources
 *       location: West Europe
 *   exampleWorkflow:
 *     type: azure:logicapps:Workflow
 *     name: example
 *     properties:
 *       name: workflow1
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *   exampleActionHttp:
 *     type: azure:logicapps:ActionHttp
 *     name: example
 *     properties:
 *       name: webhook
 *       logicAppId: ${exampleWorkflow.id}
 *       method: GET
 *       uri: http://example.com/some-webhook
 * ```
 * 
 * ## Import
 * Logic App HTTP Actions can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:logicapps/actionHttp:ActionHttp webhook1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Logic/workflows/workflow1/actions/webhook1
 * ```
 * @property body Specifies the HTTP Body that should be sent to the `uri` when this HTTP Action is triggered.
 * @property headers Specifies a Map of Key-Value Pairs that should be sent to the `uri` when this HTTP Action is triggered.
 * @property logicAppId Specifies the ID of the Logic App Workflow. Changing this forces a new resource to be created.
 * @property method Specifies the HTTP Method which should be used for this HTTP Action. Possible values include `DELETE`, `GET`, `PATCH`, `POST` and `PUT`.
 * @property name Specifies the name of the HTTP Action to be created within the Logic App Workflow. Changing this forces a new resource to be created.
 * > **NOTE:** This name must be unique across all Actions within the Logic App Workflow.
 * @property queries Specifies a Map of Key-Value Pairs that should be sent to the `uri` when this HTTP Action is triggered.
 * @property runAfters Specifies the place of the HTTP Action in the Logic App Workflow. If not specified, the HTTP Action is right after the Trigger. A `run_after` block is as defined below.
 * @property uri Specifies the URI which will be called when this HTTP Action is triggered.
 */
public data class ActionHttpArgs(
    public val body: Output? = null,
    public val headers: Output>? = null,
    public val logicAppId: Output? = null,
    public val method: Output? = null,
    public val name: Output? = null,
    public val queries: Output>? = null,
    public val runAfters: Output>? = null,
    public val uri: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.logicapps.ActionHttpArgs =
        com.pulumi.azure.logicapps.ActionHttpArgs.builder()
            .body(body?.applyValue({ args0 -> args0 }))
            .headers(headers?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .logicAppId(logicAppId?.applyValue({ args0 -> args0 }))
            .method(method?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .queries(queries?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .runAfters(
                runAfters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .uri(uri?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ActionHttpArgs].
 */
@PulumiTagMarker
public class ActionHttpArgsBuilder internal constructor() {
    private var body: Output? = null

    private var headers: Output>? = null

    private var logicAppId: Output? = null

    private var method: Output? = null

    private var name: Output? = null

    private var queries: Output>? = null

    private var runAfters: Output>? = null

    private var uri: Output? = null

    /**
     * @param value Specifies the HTTP Body that should be sent to the `uri` when this HTTP Action is triggered.
     */
    @JvmName("gempqeophiscyoog")
    public suspend fun body(`value`: Output) {
        this.body = value
    }

    /**
     * @param value Specifies a Map of Key-Value Pairs that should be sent to the `uri` when this HTTP Action is triggered.
     */
    @JvmName("utrilakkwivyirca")
    public suspend fun headers(`value`: Output>) {
        this.headers = value
    }

    /**
     * @param value Specifies the ID of the Logic App Workflow. Changing this forces a new resource to be created.
     */
    @JvmName("hacvbtssyxjbssyi")
    public suspend fun logicAppId(`value`: Output) {
        this.logicAppId = value
    }

    /**
     * @param value Specifies the HTTP Method which should be used for this HTTP Action. Possible values include `DELETE`, `GET`, `PATCH`, `POST` and `PUT`.
     */
    @JvmName("gofphffupxsyjdhl")
    public suspend fun method(`value`: Output) {
        this.method = value
    }

    /**
     * @param value Specifies the name of the HTTP Action to be created within the Logic App Workflow. Changing this forces a new resource to be created.
     * > **NOTE:** This name must be unique across all Actions within the Logic App Workflow.
     */
    @JvmName("hjtdxryfswairidn")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Specifies a Map of Key-Value Pairs that should be sent to the `uri` when this HTTP Action is triggered.
     */
    @JvmName("qmucmmqaflwsuxkt")
    public suspend fun queries(`value`: Output>) {
        this.queries = value
    }

    /**
     * @param value Specifies the place of the HTTP Action in the Logic App Workflow. If not specified, the HTTP Action is right after the Trigger. A `run_after` block is as defined below.
     */
    @JvmName("etulwcreohgkcmxe")
    public suspend fun runAfters(`value`: Output>) {
        this.runAfters = value
    }

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

    /**
     * @param values Specifies the place of the HTTP Action in the Logic App Workflow. If not specified, the HTTP Action is right after the Trigger. A `run_after` block is as defined below.
     */
    @JvmName("nmwjmvuidumgecmw")
    public suspend fun runAfters(values: List>) {
        this.runAfters = Output.all(values)
    }

    /**
     * @param value Specifies the URI which will be called when this HTTP Action is triggered.
     */
    @JvmName("vdvrkhfgppmlgccj")
    public suspend fun uri(`value`: Output) {
        this.uri = value
    }

    /**
     * @param value Specifies the HTTP Body that should be sent to the `uri` when this HTTP Action is triggered.
     */
    @JvmName("wnaalosucmpjwllm")
    public suspend fun body(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.body = mapped
    }

    /**
     * @param value Specifies a Map of Key-Value Pairs that should be sent to the `uri` when this HTTP Action is triggered.
     */
    @JvmName("nscbpowdxgyymkxx")
    public suspend fun headers(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.headers = mapped
    }

    /**
     * @param values Specifies a Map of Key-Value Pairs that should be sent to the `uri` when this HTTP Action is triggered.
     */
    @JvmName("kwfnrqutuoyxypsq")
    public fun headers(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.headers = mapped
    }

    /**
     * @param value Specifies the ID of the Logic App Workflow. Changing this forces a new resource to be created.
     */
    @JvmName("knqkiccntrrpllsc")
    public suspend fun logicAppId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.logicAppId = mapped
    }

    /**
     * @param value Specifies the HTTP Method which should be used for this HTTP Action. Possible values include `DELETE`, `GET`, `PATCH`, `POST` and `PUT`.
     */
    @JvmName("oxquqedfvwsfkhei")
    public suspend fun method(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.method = mapped
    }

    /**
     * @param value Specifies the name of the HTTP Action to be created within the Logic App Workflow. Changing this forces a new resource to be created.
     * > **NOTE:** This name must be unique across all Actions within the Logic App Workflow.
     */
    @JvmName("ibfblwndlifweybr")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Specifies a Map of Key-Value Pairs that should be sent to the `uri` when this HTTP Action is triggered.
     */
    @JvmName("octwltvgqndiomok")
    public suspend fun queries(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.queries = mapped
    }

    /**
     * @param values Specifies a Map of Key-Value Pairs that should be sent to the `uri` when this HTTP Action is triggered.
     */
    @JvmName("dgtjijsrxwhlinty")
    public fun queries(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.queries = mapped
    }

    /**
     * @param value Specifies the place of the HTTP Action in the Logic App Workflow. If not specified, the HTTP Action is right after the Trigger. A `run_after` block is as defined below.
     */
    @JvmName("wlkooaobqttkgnoj")
    public suspend fun runAfters(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.runAfters = mapped
    }

    /**
     * @param argument Specifies the place of the HTTP Action in the Logic App Workflow. If not specified, the HTTP Action is right after the Trigger. A `run_after` block is as defined below.
     */
    @JvmName("eioxpvlgwawpsudd")
    public suspend fun runAfters(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ActionHttpRunAfterArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.runAfters = mapped
    }

    /**
     * @param argument Specifies the place of the HTTP Action in the Logic App Workflow. If not specified, the HTTP Action is right after the Trigger. A `run_after` block is as defined below.
     */
    @JvmName("fskwquavvxfqrjck")
    public suspend fun runAfters(vararg argument: suspend ActionHttpRunAfterArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ActionHttpRunAfterArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.runAfters = mapped
    }

    /**
     * @param argument Specifies the place of the HTTP Action in the Logic App Workflow. If not specified, the HTTP Action is right after the Trigger. A `run_after` block is as defined below.
     */
    @JvmName("rsbbpbbmajvmckta")
    public suspend fun runAfters(argument: suspend ActionHttpRunAfterArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ActionHttpRunAfterArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.runAfters = mapped
    }

    /**
     * @param values Specifies the place of the HTTP Action in the Logic App Workflow. If not specified, the HTTP Action is right after the Trigger. A `run_after` block is as defined below.
     */
    @JvmName("iyntcmhckmhbmlam")
    public suspend fun runAfters(vararg values: ActionHttpRunAfterArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.runAfters = mapped
    }

    /**
     * @param value Specifies the URI which will be called when this HTTP Action is triggered.
     */
    @JvmName("gfqwouywyisfdwck")
    public suspend fun uri(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.uri = mapped
    }

    internal fun build(): ActionHttpArgs = ActionHttpArgs(
        body = body,
        headers = headers,
        logicAppId = logicAppId,
        method = method,
        name = name,
        queries = queries,
        runAfters = runAfters,
        uri = uri,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy