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

com.pulumi.azure.streamanalytics.kotlin.OutputPowerbi.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.streamanalytics.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [OutputPowerbi].
 */
@PulumiTagMarker
public class OutputPowerbiResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: OutputPowerbiArgs = OutputPowerbiArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend OutputPowerbiArgsBuilder.() -> Unit) {
        val builder = OutputPowerbiArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): OutputPowerbi {
        val builtJavaResource = com.pulumi.azure.streamanalytics.OutputPowerbi(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return OutputPowerbi(builtJavaResource)
    }
}

/**
 * Manages a Stream Analytics Output powerBI.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = azure.core.getResourceGroup({
 *     name: "example-resources",
 * });
 * const exampleGetJob = example.then(example => azure.streamanalytics.getJob({
 *     name: "example-job",
 *     resourceGroupName: example.name,
 * }));
 * const exampleOutputPowerbi = new azure.streamanalytics.OutputPowerbi("example", {
 *     name: "output-to-powerbi",
 *     streamAnalyticsJobId: exampleGetJob.then(exampleGetJob => exampleGetJob.id),
 *     dataset: "example-dataset",
 *     table: "example-table",
 *     groupId: "00000000-0000-0000-0000-000000000000",
 *     groupName: "some-group-name",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.get_resource_group(name="example-resources")
 * example_get_job = azure.streamanalytics.get_job(name="example-job",
 *     resource_group_name=example.name)
 * example_output_powerbi = azure.streamanalytics.OutputPowerbi("example",
 *     name="output-to-powerbi",
 *     stream_analytics_job_id=example_get_job.id,
 *     dataset="example-dataset",
 *     table="example-table",
 *     group_id="00000000-0000-0000-0000-000000000000",
 *     group_name="some-group-name")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = Azure.Core.GetResourceGroup.Invoke(new()
 *     {
 *         Name = "example-resources",
 *     });
 *     var exampleGetJob = Azure.StreamAnalytics.GetJob.Invoke(new()
 *     {
 *         Name = "example-job",
 *         ResourceGroupName = example.Apply(getResourceGroupResult => getResourceGroupResult.Name),
 *     });
 *     var exampleOutputPowerbi = new Azure.StreamAnalytics.OutputPowerbi("example", new()
 *     {
 *         Name = "output-to-powerbi",
 *         StreamAnalyticsJobId = exampleGetJob.Apply(getJobResult => getJobResult.Id),
 *         Dataset = "example-dataset",
 *         Table = "example-table",
 *         GroupId = "00000000-0000-0000-0000-000000000000",
 *         GroupName = "some-group-name",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/streamanalytics"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.LookupResourceGroup(ctx, &core.LookupResourceGroupArgs{
 * 			Name: "example-resources",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleGetJob, err := streamanalytics.LookupJob(ctx, &streamanalytics.LookupJobArgs{
 * 			Name:              "example-job",
 * 			ResourceGroupName: example.Name,
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = streamanalytics.NewOutputPowerbi(ctx, "example", &streamanalytics.OutputPowerbiArgs{
 * 			Name:                 pulumi.String("output-to-powerbi"),
 * 			StreamAnalyticsJobId: pulumi.String(exampleGetJob.Id),
 * 			Dataset:              pulumi.String("example-dataset"),
 * 			Table:                pulumi.String("example-table"),
 * 			GroupId:              pulumi.String("00000000-0000-0000-0000-000000000000"),
 * 			GroupName:            pulumi.String("some-group-name"),
 * 		})
 * 		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.inputs.GetResourceGroupArgs;
 * import com.pulumi.azure.streamanalytics.StreamanalyticsFunctions;
 * import com.pulumi.azure.streamanalytics.inputs.GetJobArgs;
 * import com.pulumi.azure.streamanalytics.OutputPowerbi;
 * import com.pulumi.azure.streamanalytics.OutputPowerbiArgs;
 * 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 = CoreFunctions.getResourceGroup(GetResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .build());
 *         final var exampleGetJob = StreamanalyticsFunctions.getJob(GetJobArgs.builder()
 *             .name("example-job")
 *             .resourceGroupName(example.applyValue(getResourceGroupResult -> getResourceGroupResult.name()))
 *             .build());
 *         var exampleOutputPowerbi = new OutputPowerbi("exampleOutputPowerbi", OutputPowerbiArgs.builder()
 *             .name("output-to-powerbi")
 *             .streamAnalyticsJobId(exampleGetJob.applyValue(getJobResult -> getJobResult.id()))
 *             .dataset("example-dataset")
 *             .table("example-table")
 *             .groupId("00000000-0000-0000-0000-000000000000")
 *             .groupName("some-group-name")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   exampleOutputPowerbi:
 *     type: azure:streamanalytics:OutputPowerbi
 *     name: example
 *     properties:
 *       name: output-to-powerbi
 *       streamAnalyticsJobId: ${exampleGetJob.id}
 *       dataset: example-dataset
 *       table: example-table
 *       groupId: 00000000-0000-0000-0000-000000000000
 *       groupName: some-group-name
 * variables:
 *   example:
 *     fn::invoke:
 *       Function: azure:core:getResourceGroup
 *       Arguments:
 *         name: example-resources
 *   exampleGetJob:
 *     fn::invoke:
 *       Function: azure:streamanalytics:getJob
 *       Arguments:
 *         name: example-job
 *         resourceGroupName: ${example.name}
 * ```
 * 
 * ## Import
 * Stream Analytics Output to Power BI can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:streamanalytics/outputPowerbi:OutputPowerbi example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StreamAnalytics/streamingJobs/job1/outputs/output1
 * ```
 */
public class OutputPowerbi internal constructor(
    override val javaResource: com.pulumi.azure.streamanalytics.OutputPowerbi,
) : KotlinCustomResource(javaResource, OutputPowerbiMapper) {
    /**
     * The name of the Power BI dataset.
     */
    public val dataset: Output
        get() = javaResource.dataset().applyValue({ args0 -> args0 })

    /**
     * The ID of the Power BI group, this must be a valid UUID.
     */
    public val groupId: Output
        get() = javaResource.groupId().applyValue({ args0 -> args0 })

    /**
     * The name of the Power BI group. Use this property to help remember which specific Power BI group id was used.
     */
    public val groupName: Output
        get() = javaResource.groupName().applyValue({ args0 -> args0 })

    /**
     * The name of the Stream Output. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The ID of the Stream Analytics Job. Changing this forces a new resource to be created.
     */
    public val streamAnalyticsJobId: Output
        get() = javaResource.streamAnalyticsJobId().applyValue({ args0 -> args0 })

    /**
     * The name of the Power BI table under the specified dataset.
     */
    public val table: Output
        get() = javaResource.table().applyValue({ args0 -> args0 })

    /**
     * The user display name of the user that was used to obtain the refresh token.
     */
    public val tokenUserDisplayName: Output?
        get() = javaResource.tokenUserDisplayName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The user principal name (UPN) of the user that was used to obtain the refresh token.
     */
    public val tokenUserPrincipalName: Output?
        get() = javaResource.tokenUserPrincipalName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object OutputPowerbiMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.streamanalytics.OutputPowerbi::class == javaResource::class

    override fun map(javaResource: Resource): OutputPowerbi = OutputPowerbi(
        javaResource as
            com.pulumi.azure.streamanalytics.OutputPowerbi,
    )
}

/**
 * @see [OutputPowerbi].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [OutputPowerbi].
 */
public suspend fun outputPowerbi(
    name: String,
    block: suspend OutputPowerbiResourceBuilder.() -> Unit,
): OutputPowerbi {
    val builder = OutputPowerbiResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [OutputPowerbi].
 * @param name The _unique_ name of the resulting resource.
 */
public fun outputPowerbi(name: String): OutputPowerbi {
    val builder = OutputPowerbiResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy