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

com.pulumi.azure.appinsights.kotlin.WorkbookArgs.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.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.appinsights.kotlin

import com.pulumi.azure.appinsights.WorkbookArgs.builder
import com.pulumi.azure.appinsights.kotlin.inputs.WorkbookIdentityArgs
import com.pulumi.azure.appinsights.kotlin.inputs.WorkbookIdentityArgsBuilder
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

/**
 * Manages an Azure Workbook.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleWorkbook = new azure.appinsights.Workbook("example", {
 *     name: "85b3e8bb-fc93-40be-83f2-98f6bec18ba0",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     displayName: "workbook1",
 *     dataJson: JSON.stringify({
 *         version: "Notebook/1.0",
 *         items: [{
 *             type: 1,
 *             content: {
 *                 json: "Test2022",
 *             },
 *             name: "text - 0",
 *         }],
 *         isLocked: false,
 *         fallbackResourceIds: ["Azure Monitor"],
 *     }),
 *     tags: {
 *         ENV: "Test",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import json
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_workbook = azure.appinsights.Workbook("example",
 *     name="85b3e8bb-fc93-40be-83f2-98f6bec18ba0",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     display_name="workbook1",
 *     data_json=json.dumps({
 *         "version": "Notebook/1.0",
 *         "items": [{
 *             "type": 1,
 *             "content": {
 *                 "json": "Test2022",
 *             },
 *             "name": "text - 0",
 *         }],
 *         "isLocked": False,
 *         "fallbackResourceIds": ["Azure Monitor"],
 *     }),
 *     tags={
 *         "ENV": "Test",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using System.Text.Json;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleWorkbook = new Azure.AppInsights.Workbook("example", new()
 *     {
 *         Name = "85b3e8bb-fc93-40be-83f2-98f6bec18ba0",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         DisplayName = "workbook1",
 *         DataJson = JsonSerializer.Serialize(new Dictionary
 *         {
 *             ["version"] = "Notebook/1.0",
 *             ["items"] = new[]
 *             {
 *                 new Dictionary
 *                 {
 *                     ["type"] = 1,
 *                     ["content"] = new Dictionary
 *                     {
 *                         ["json"] = "Test2022",
 *                     },
 *                     ["name"] = "text - 0",
 *                 },
 *             },
 *             ["isLocked"] = false,
 *             ["fallbackResourceIds"] = new[]
 *             {
 *                 "Azure Monitor",
 *             },
 *         }),
 *         Tags =
 *         {
 *             { "ENV", "Test" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"encoding/json"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights"
 * 	"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 {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		tmpJSON0, err := json.Marshal(map[string]interface{}{
 * 			"version": "Notebook/1.0",
 * 			"items": []map[string]interface{}{
 * 				map[string]interface{}{
 * 					"type": 1,
 * 					"content": map[string]interface{}{
 * 						"json": "Test2022",
 * 					},
 * 					"name": "text - 0",
 * 				},
 * 			},
 * 			"isLocked": false,
 * 			"fallbackResourceIds": []string{
 * 				"Azure Monitor",
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		json0 := string(tmpJSON0)
 * 		_, err = appinsights.NewWorkbook(ctx, "example", &appinsights.WorkbookArgs{
 * 			Name:              pulumi.String("85b3e8bb-fc93-40be-83f2-98f6bec18ba0"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			DisplayName:       pulumi.String("workbook1"),
 * 			DataJson:          pulumi.String(json0),
 * 			Tags: pulumi.StringMap{
 * 				"ENV": pulumi.String("Test"),
 * 			},
 * 		})
 * 		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.appinsights.Workbook;
 * import com.pulumi.azure.appinsights.WorkbookArgs;
 * import static com.pulumi.codegen.internal.Serialization.*;
 * 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("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleWorkbook = new Workbook("exampleWorkbook", WorkbookArgs.builder()
 *             .name("85b3e8bb-fc93-40be-83f2-98f6bec18ba0")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .displayName("workbook1")
 *             .dataJson(serializeJson(
 *                 jsonObject(
 *                     jsonProperty("version", "Notebook/1.0"),
 *                     jsonProperty("items", jsonArray(jsonObject(
 *                         jsonProperty("type", 1),
 *                         jsonProperty("content", jsonObject(
 *                             jsonProperty("json", "Test2022")
 *                         )),
 *                         jsonProperty("name", "text - 0")
 *                     ))),
 *                     jsonProperty("isLocked", false),
 *                     jsonProperty("fallbackResourceIds", jsonArray("Azure Monitor"))
 *                 )))
 *             .tags(Map.of("ENV", "Test"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleWorkbook:
 *     type: azure:appinsights:Workbook
 *     name: example
 *     properties:
 *       name: 85b3e8bb-fc93-40be-83f2-98f6bec18ba0
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       displayName: workbook1
 *       dataJson:
 *         fn::toJSON:
 *           version: Notebook/1.0
 *           items:
 *             - type: 1
 *               content:
 *                 json: Test2022
 *               name: text - 0
 *           isLocked: false
 *           fallbackResourceIds:
 *             - Azure Monitor
 *       tags:
 *         ENV: Test
 * ```
 * 
 * ## Import
 * Workbooks can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appinsights/workbook:Workbook example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Insights/workbooks/resource1
 * ```
 * @property category Workbook category, as defined by the user at creation time. There may be additional category types beyond the following: `workbook`, `sentinel`. Defaults to `workbook`.
 * @property dataJson Configuration of this particular workbook. Configuration data is a string containing valid JSON.
 * @property description Specifies the description of the workbook.
 * @property displayName Specifies the user-defined name (display name) of the workbook.
 * @property identity An `identity` block as defined below. Changing this forces a new Workbook to be created.
 * @property location Specifies the Azure Region where the Workbook should exist. Changing this forces a new Workbook to be created.
 * @property name Specifies the name of this Workbook as a UUID/GUID. It should not contain any uppercase letters. Changing this forces a new Workbook to be created.
 * @property resourceGroupName Specifies the name of the Resource Group where the Workbook should exist. Changing this forces a new Workbook to be created.
 * @property sourceId Resource ID for a source resource. It should not contain any uppercase letters. Defaults to `azure monitor`.
 * @property storageContainerId Specifies the Resource Manager ID of the Storage Container when bring your own storage is used. Changing this forces a new Workbook to be created.
 * > **Note:** This is the Resource Manager ID of the Storage Container, rather than the regular ID - and can be accessed on the `azure.storage.Container` Data Source/Resource as `resource_manager_id`.
 * @property tags A mapping of tags which should be assigned to the Workbook.
 */
public data class WorkbookArgs(
    public val category: Output? = null,
    public val dataJson: Output? = null,
    public val description: Output? = null,
    public val displayName: Output? = null,
    public val identity: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val sourceId: Output? = null,
    public val storageContainerId: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.appinsights.WorkbookArgs =
        com.pulumi.azure.appinsights.WorkbookArgs.builder()
            .category(category?.applyValue({ args0 -> args0 }))
            .dataJson(dataJson?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .sourceId(sourceId?.applyValue({ args0 -> args0 }))
            .storageContainerId(storageContainerId?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [WorkbookArgs].
 */
@PulumiTagMarker
public class WorkbookArgsBuilder internal constructor() {
    private var category: Output? = null

    private var dataJson: Output? = null

    private var description: Output? = null

    private var displayName: Output? = null

    private var identity: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var sourceId: Output? = null

    private var storageContainerId: Output? = null

    private var tags: Output>? = null

    /**
     * @param value Workbook category, as defined by the user at creation time. There may be additional category types beyond the following: `workbook`, `sentinel`. Defaults to `workbook`.
     */
    @JvmName("bqrmjijhmmhbdcnc")
    public suspend fun category(`value`: Output) {
        this.category = value
    }

    /**
     * @param value Configuration of this particular workbook. Configuration data is a string containing valid JSON.
     */
    @JvmName("pbvrpbadmawjeths")
    public suspend fun dataJson(`value`: Output) {
        this.dataJson = value
    }

    /**
     * @param value Specifies the description of the workbook.
     */
    @JvmName("rvauijwhsoalrowx")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Specifies the user-defined name (display name) of the workbook.
     */
    @JvmName("gxktjqqykvlgfccg")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value An `identity` block as defined below. Changing this forces a new Workbook to be created.
     */
    @JvmName("oadasxkwxdyhpuxc")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

    /**
     * @param value Specifies the Azure Region where the Workbook should exist. Changing this forces a new Workbook to be created.
     */
    @JvmName("sjmaearhwbhvumwy")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Specifies the name of this Workbook as a UUID/GUID. It should not contain any uppercase letters. Changing this forces a new Workbook to be created.
     */
    @JvmName("tpuadqcepcuqrjtn")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Specifies the name of the Resource Group where the Workbook should exist. Changing this forces a new Workbook to be created.
     */
    @JvmName("wtkdgoxhjvfvtubh")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Resource ID for a source resource. It should not contain any uppercase letters. Defaults to `azure monitor`.
     */
    @JvmName("hvdvdabdvinqexig")
    public suspend fun sourceId(`value`: Output) {
        this.sourceId = value
    }

    /**
     * @param value Specifies the Resource Manager ID of the Storage Container when bring your own storage is used. Changing this forces a new Workbook to be created.
     * > **Note:** This is the Resource Manager ID of the Storage Container, rather than the regular ID - and can be accessed on the `azure.storage.Container` Data Source/Resource as `resource_manager_id`.
     */
    @JvmName("xvrytnnlhpwrjaup")
    public suspend fun storageContainerId(`value`: Output) {
        this.storageContainerId = value
    }

    /**
     * @param value A mapping of tags which should be assigned to the Workbook.
     */
    @JvmName("acjmdtakqjhfhdld")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Workbook category, as defined by the user at creation time. There may be additional category types beyond the following: `workbook`, `sentinel`. Defaults to `workbook`.
     */
    @JvmName("cunyipatispovuov")
    public suspend fun category(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.category = mapped
    }

    /**
     * @param value Configuration of this particular workbook. Configuration data is a string containing valid JSON.
     */
    @JvmName("fjdvtmaltdidluuf")
    public suspend fun dataJson(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dataJson = mapped
    }

    /**
     * @param value Specifies the description of the workbook.
     */
    @JvmName("lnuxhjrplboodguo")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Specifies the user-defined name (display name) of the workbook.
     */
    @JvmName("vksxeimiyaksvuye")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value An `identity` block as defined below. Changing this forces a new Workbook to be created.
     */
    @JvmName("tqgoeyrgspfmhvlv")
    public suspend fun identity(`value`: WorkbookIdentityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

    /**
     * @param argument An `identity` block as defined below. Changing this forces a new Workbook to be created.
     */
    @JvmName("xxyqbcpiuyicspao")
    public suspend fun identity(argument: suspend WorkbookIdentityArgsBuilder.() -> Unit) {
        val toBeMapped = WorkbookIdentityArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

    /**
     * @param value Specifies the Azure Region where the Workbook should exist. Changing this forces a new Workbook to be created.
     */
    @JvmName("ogsllpvypisjulqr")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Specifies the name of this Workbook as a UUID/GUID. It should not contain any uppercase letters. Changing this forces a new Workbook to be created.
     */
    @JvmName("jayfqcsqsyyooeln")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Specifies the name of the Resource Group where the Workbook should exist. Changing this forces a new Workbook to be created.
     */
    @JvmName("oyeyrcfrtpmjsgwi")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Resource ID for a source resource. It should not contain any uppercase letters. Defaults to `azure monitor`.
     */
    @JvmName("vynglalhhvuabagm")
    public suspend fun sourceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceId = mapped
    }

    /**
     * @param value Specifies the Resource Manager ID of the Storage Container when bring your own storage is used. Changing this forces a new Workbook to be created.
     * > **Note:** This is the Resource Manager ID of the Storage Container, rather than the regular ID - and can be accessed on the `azure.storage.Container` Data Source/Resource as `resource_manager_id`.
     */
    @JvmName("vvddvpjiqdnddqtv")
    public suspend fun storageContainerId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.storageContainerId = mapped
    }

    /**
     * @param value A mapping of tags which should be assigned to the Workbook.
     */
    @JvmName("xyruukdbkyqtexvb")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags which should be assigned to the Workbook.
     */
    @JvmName("vskpmekpertgcibx")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): WorkbookArgs = WorkbookArgs(
        category = category,
        dataJson = dataJson,
        description = description,
        displayName = displayName,
        identity = identity,
        location = location,
        name = name,
        resourceGroupName = resourceGroupName,
        sourceId = sourceId,
        storageContainerId = storageContainerId,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy