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

com.pulumi.azurenative.web.kotlin.ConnectionArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.web.kotlin

import com.pulumi.azurenative.web.ConnectionArgs.builder
import com.pulumi.azurenative.web.kotlin.inputs.ApiConnectionDefinitionPropertiesArgs
import com.pulumi.azurenative.web.kotlin.inputs.ApiConnectionDefinitionPropertiesArgsBuilder
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.Map
import kotlin.jvm.JvmName

/**
 * API connection
 * Azure REST API version: 2016-06-01. Prior API version in Azure Native 1.x: 2016-06-01.
 * Other available API versions: 2015-08-01-preview.
 * ## Example Usage
 * ### Replace a connection
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var connection = new AzureNative.Web.Connection("connection", new()
 *     {
 *         ConnectionName = "testManagedApi",
 *         Properties = new AzureNative.Web.Inputs.ApiConnectionDefinitionPropertiesArgs
 *         {
 *             Api = new AzureNative.Web.Inputs.ApiReferenceArgs
 *             {
 *                 Id = "/subscriptions/f34b22a3-2202-4fb1-b040-1332bd928c84/providers/Microsoft.Web/locations/centralus/managedApis/testManagedApi",
 *             },
 *             CustomParameterValues = null,
 *             DisplayName = "testManagedApi",
 *             ParameterValues = null,
 *         },
 *         ResourceGroupName = "testResourceGroup",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	web "github.com/pulumi/pulumi-azure-native-sdk/web/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := web.NewConnection(ctx, "connection", &web.ConnectionArgs{
 * 			ConnectionName: pulumi.String("testManagedApi"),
 * 			Properties: &web.ApiConnectionDefinitionPropertiesArgs{
 * 				Api: &web.ApiReferenceArgs{
 * 					Id: pulumi.String("/subscriptions/f34b22a3-2202-4fb1-b040-1332bd928c84/providers/Microsoft.Web/locations/centralus/managedApis/testManagedApi"),
 * 				},
 * 				CustomParameterValues: nil,
 * 				DisplayName:           pulumi.String("testManagedApi"),
 * 				ParameterValues:       nil,
 * 			},
 * 			ResourceGroupName: pulumi.String("testResourceGroup"),
 * 		})
 * 		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.web.Connection;
 * import com.pulumi.azurenative.web.ConnectionArgs;
 * import com.pulumi.azurenative.web.inputs.ApiConnectionDefinitionPropertiesArgs;
 * import com.pulumi.azurenative.web.inputs.ApiReferenceArgs;
 * 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 connection = new Connection("connection", ConnectionArgs.builder()
 *             .connectionName("testManagedApi")
 *             .properties(ApiConnectionDefinitionPropertiesArgs.builder()
 *                 .api(ApiReferenceArgs.builder()
 *                     .id("/subscriptions/f34b22a3-2202-4fb1-b040-1332bd928c84/providers/Microsoft.Web/locations/centralus/managedApis/testManagedApi")
 *                     .build())
 *                 .customParameterValues()
 *                 .displayName("testManagedApi")
 *                 .parameterValues()
 *                 .build())
 *             .resourceGroupName("testResourceGroup")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:web:Connection testManagedApi-1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/connections/{connectionName}
 * ```
 * @property connectionName Connection name
 * @property location Resource location
 * @property properties
 * @property resourceGroupName The resource group
 * @property subscriptionId Subscription Id
 * @property tags Resource tags
 */
public data class ConnectionArgs(
    public val connectionName: Output? = null,
    public val location: Output? = null,
    public val properties: Output? = null,
    public val resourceGroupName: Output? = null,
    public val subscriptionId: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.web.ConnectionArgs =
        com.pulumi.azurenative.web.ConnectionArgs.builder()
            .connectionName(connectionName?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .properties(properties?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .subscriptionId(subscriptionId?.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 connectionName: Output? = null

    private var location: Output? = null

    private var properties: Output? = null

    private var resourceGroupName: Output? = null

    private var subscriptionId: Output? = null

    private var tags: Output>? = null

    /**
     * @param value Connection name
     */
    @JvmName("exlfwvsqwnvkcmns")
    public suspend fun connectionName(`value`: Output) {
        this.connectionName = value
    }

    /**
     * @param value Resource location
     */
    @JvmName("jfienouvnvvwoioe")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value
     */
    @JvmName("evpkedlcrqjvqdse")
    public suspend fun properties(`value`: Output) {
        this.properties = value
    }

    /**
     * @param value The resource group
     */
    @JvmName("uyifcfecrfliwcnj")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Subscription Id
     */
    @JvmName("npqbovfvlcgpveaq")
    public suspend fun subscriptionId(`value`: Output) {
        this.subscriptionId = value
    }

    /**
     * @param value Resource tags
     */
    @JvmName("sttfaiitbvixgwtv")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Connection name
     */
    @JvmName("mdkxknsfbhwkfqds")
    public suspend fun connectionName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.connectionName = mapped
    }

    /**
     * @param value Resource location
     */
    @JvmName("enxooiqnqllmebev")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value
     */
    @JvmName("nflwxmxprbrgjbjr")
    public suspend fun properties(`value`: ApiConnectionDefinitionPropertiesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.properties = mapped
    }

    /**
     * @param argument
     */
    @JvmName("rfdmgubmbqcwqseg")
    public suspend fun properties(argument: suspend ApiConnectionDefinitionPropertiesArgsBuilder.() -> Unit) {
        val toBeMapped = ApiConnectionDefinitionPropertiesArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.properties = mapped
    }

    /**
     * @param value The resource group
     */
    @JvmName("nsdehkilgcbxvhbg")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Subscription Id
     */
    @JvmName("pfnmykxuusrgcwja")
    public suspend fun subscriptionId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subscriptionId = mapped
    }

    /**
     * @param value Resource tags
     */
    @JvmName("inaemgcoowxlckyi")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Resource tags
     */
    @JvmName("obxnakikjcyiuvsc")
    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(
        connectionName = connectionName,
        location = location,
        properties = properties,
        resourceGroupName = resourceGroupName,
        subscriptionId = subscriptionId,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy