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

com.pulumi.azure.webpubsub.kotlin.WebpubsubFunctions.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.webpubsub.kotlin

import com.pulumi.azure.webpubsub.WebpubsubFunctions.getPrivateLinkResourcePlain
import com.pulumi.azure.webpubsub.WebpubsubFunctions.getServicePlain
import com.pulumi.azure.webpubsub.kotlin.inputs.GetPrivateLinkResourcePlainArgs
import com.pulumi.azure.webpubsub.kotlin.inputs.GetPrivateLinkResourcePlainArgsBuilder
import com.pulumi.azure.webpubsub.kotlin.inputs.GetServicePlainArgs
import com.pulumi.azure.webpubsub.kotlin.inputs.GetServicePlainArgsBuilder
import com.pulumi.azure.webpubsub.kotlin.outputs.GetPrivateLinkResourceResult
import com.pulumi.azure.webpubsub.kotlin.outputs.GetServiceResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.azure.webpubsub.kotlin.outputs.GetPrivateLinkResourceResult.Companion.toKotlin as getPrivateLinkResourceResultToKotlin
import com.pulumi.azure.webpubsub.kotlin.outputs.GetServiceResult.Companion.toKotlin as getServiceResultToKotlin

public object WebpubsubFunctions {
    /**
     * Use this data source to access information about the Private Link Resource supported by the Web Pubsub Resource.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as azure from "@pulumi/azure";
     * const testResourceGroup = new azure.core.ResourceGroup("test", {
     *     name: "terraform-webpubsub",
     *     location: "east us",
     * });
     * const testService = new azure.webpubsub.Service("test", {
     *     name: "tfex-webpubsub",
     *     location: testResourceGroup.location,
     *     resourceGroupName: testResourceGroup.name,
     *     sku: "Standard_S1",
     *     capacity: 1,
     * });
     * const test = azure.webpubsub.getPrivateLinkResourceOutput({
     *     webPubsubId: testService.id,
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_azure as azure
     * test_resource_group = azure.core.ResourceGroup("test",
     *     name="terraform-webpubsub",
     *     location="east us")
     * test_service = azure.webpubsub.Service("test",
     *     name="tfex-webpubsub",
     *     location=test_resource_group.location,
     *     resource_group_name=test_resource_group.name,
     *     sku="Standard_S1",
     *     capacity=1)
     * test = azure.webpubsub.get_private_link_resource_output(web_pubsub_id=test_service.id)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Azure = Pulumi.Azure;
     * return await Deployment.RunAsync(() =>
     * {
     *     var testResourceGroup = new Azure.Core.ResourceGroup("test", new()
     *     {
     *         Name = "terraform-webpubsub",
     *         Location = "east us",
     *     });
     *     var testService = new Azure.WebPubSub.Service("test", new()
     *     {
     *         Name = "tfex-webpubsub",
     *         Location = testResourceGroup.Location,
     *         ResourceGroupName = testResourceGroup.Name,
     *         Sku = "Standard_S1",
     *         Capacity = 1,
     *     });
     *     var test = Azure.WebPubSub.GetPrivateLinkResource.Invoke(new()
     *     {
     *         WebPubsubId = testService.Id,
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
     * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/webpubsub"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		testResourceGroup, err := core.NewResourceGroup(ctx, "test", &core.ResourceGroupArgs{
     * 			Name:     pulumi.String("terraform-webpubsub"),
     * 			Location: pulumi.String("east us"),
     * 		})
     * 		if err != nil {
     * 			return err
     * 		}
     * 		testService, err := webpubsub.NewService(ctx, "test", &webpubsub.ServiceArgs{
     * 			Name:              pulumi.String("tfex-webpubsub"),
     * 			Location:          testResourceGroup.Location,
     * 			ResourceGroupName: testResourceGroup.Name,
     * 			Sku:               pulumi.String("Standard_S1"),
     * 			Capacity:          pulumi.Int(1),
     * 		})
     * 		if err != nil {
     * 			return err
     * 		}
     * 		_ = webpubsub.GetPrivateLinkResourceOutput(ctx, webpubsub.GetPrivateLinkResourceOutputArgs{
     * 			WebPubsubId: testService.ID(),
     * 		}, nil)
     * 		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.webpubsub.Service;
     * import com.pulumi.azure.webpubsub.ServiceArgs;
     * import com.pulumi.azure.webpubsub.WebpubsubFunctions;
     * import com.pulumi.azure.webpubsub.inputs.GetPrivateLinkResourceArgs;
     * 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 testResourceGroup = new ResourceGroup("testResourceGroup", ResourceGroupArgs.builder()
     *             .name("terraform-webpubsub")
     *             .location("east us")
     *             .build());
     *         var testService = new Service("testService", ServiceArgs.builder()
     *             .name("tfex-webpubsub")
     *             .location(testResourceGroup.location())
     *             .resourceGroupName(testResourceGroup.name())
     *             .sku("Standard_S1")
     *             .capacity(1)
     *             .build());
     *         final var test = WebpubsubFunctions.getPrivateLinkResource(GetPrivateLinkResourceArgs.builder()
     *             .webPubsubId(testService.id())
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * resources:
     *   testResourceGroup:
     *     type: azure:core:ResourceGroup
     *     name: test
     *     properties:
     *       name: terraform-webpubsub
     *       location: east us
     *   testService:
     *     type: azure:webpubsub:Service
     *     name: test
     *     properties:
     *       name: tfex-webpubsub
     *       location: ${testResourceGroup.location}
     *       resourceGroupName: ${testResourceGroup.name}
     *       sku: Standard_S1
     *       capacity: 1
     * variables:
     *   test:
     *     fn::invoke:
     *       Function: azure:webpubsub:getPrivateLinkResource
     *       Arguments:
     *         webPubsubId: ${testService.id}
     * ```
     * 
     * @param argument A collection of arguments for invoking getPrivateLinkResource.
     * @return A collection of values returned by getPrivateLinkResource.
     */
    public suspend fun getPrivateLinkResource(argument: GetPrivateLinkResourcePlainArgs):
        GetPrivateLinkResourceResult =
        getPrivateLinkResourceResultToKotlin(getPrivateLinkResourcePlain(argument.toJava()).await())

    /**
     * @see [getPrivateLinkResource].
     * @param webPubsubId The ID of an existing Web Pubsub Resource which Private Link Resource should be retrieved for.
     * @return A collection of values returned by getPrivateLinkResource.
     */
    public suspend fun getPrivateLinkResource(webPubsubId: String): GetPrivateLinkResourceResult {
        val argument = GetPrivateLinkResourcePlainArgs(
            webPubsubId = webPubsubId,
        )
        return getPrivateLinkResourceResultToKotlin(getPrivateLinkResourcePlain(argument.toJava()).await())
    }

    /**
     * @see [getPrivateLinkResource].
     * @param argument Builder for [com.pulumi.azure.webpubsub.kotlin.inputs.GetPrivateLinkResourcePlainArgs].
     * @return A collection of values returned by getPrivateLinkResource.
     */
    public suspend
    fun getPrivateLinkResource(argument: suspend GetPrivateLinkResourcePlainArgsBuilder.() -> Unit):
        GetPrivateLinkResourceResult {
        val builder = GetPrivateLinkResourcePlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getPrivateLinkResourceResultToKotlin(getPrivateLinkResourcePlain(builtArgument.toJava()).await())
    }

    /**
     * Use this data source to access information about an existing Azure Web Pubsub service.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as azure from "@pulumi/azure";
     * const example = azure.webpubsub.getService({
     *     name: "test-webpubsub",
     *     resourceGroupName: "wps-resource-group",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_azure as azure
     * example = azure.webpubsub.get_service(name="test-webpubsub",
     *     resource_group_name="wps-resource-group")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Azure = Pulumi.Azure;
     * return await Deployment.RunAsync(() =>
     * {
     *     var example = Azure.WebPubSub.GetService.Invoke(new()
     *     {
     *         Name = "test-webpubsub",
     *         ResourceGroupName = "wps-resource-group",
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/webpubsub"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := webpubsub.LookupService(ctx, &webpubsub.LookupServiceArgs{
     * 			Name:              "test-webpubsub",
     * 			ResourceGroupName: "wps-resource-group",
     * 		}, nil)
     * 		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.webpubsub.WebpubsubFunctions;
     * import com.pulumi.azure.webpubsub.inputs.GetServiceArgs;
     * 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 example = WebpubsubFunctions.getService(GetServiceArgs.builder()
     *             .name("test-webpubsub")
     *             .resourceGroupName("wps-resource-group")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: azure:webpubsub:getService
     *       Arguments:
     *         name: test-webpubsub
     *         resourceGroupName: wps-resource-group
     * ```
     * 
     * @param argument A collection of arguments for invoking getService.
     * @return A collection of values returned by getService.
     */
    public suspend fun getService(argument: GetServicePlainArgs): GetServiceResult =
        getServiceResultToKotlin(getServicePlain(argument.toJava()).await())

    /**
     * @see [getService].
     * @param name Specifies the name of the Web Pubsub service.
     * @param resourceGroupName Specifies the name of the resource group the Web Pubsub service is located in.
     * @return A collection of values returned by getService.
     */
    public suspend fun getService(name: String, resourceGroupName: String): GetServiceResult {
        val argument = GetServicePlainArgs(
            name = name,
            resourceGroupName = resourceGroupName,
        )
        return getServiceResultToKotlin(getServicePlain(argument.toJava()).await())
    }

    /**
     * @see [getService].
     * @param argument Builder for [com.pulumi.azure.webpubsub.kotlin.inputs.GetServicePlainArgs].
     * @return A collection of values returned by getService.
     */
    public suspend fun getService(argument: suspend GetServicePlainArgsBuilder.() -> Unit):
        GetServiceResult {
        val builder = GetServicePlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getServiceResultToKotlin(getServicePlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy