// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.portal;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.portal.DashboardArgs;
import com.pulumi.azure.portal.inputs.DashboardState;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a shared dashboard in the Azure Portal.
 * 
 * !&gt; **Note:** The `azure.portal.Dashboard` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.portal.PortalDashboard` resource instead.
 * 
 * ## Example Usage
 * ```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.GetSubscriptionArgs;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.portal.Dashboard;
 * import com.pulumi.azure.portal.DashboardArgs;
 * 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 config = ctx.config();
 *         final var mdContent = config.get(&#34;mdContent&#34;).orElse(&#34;# Hello all :)&#34;);
 *         final var videoLink = config.get(&#34;videoLink&#34;).orElse(&#34;https://www.youtube.com/watch?v=......&#34;);
 *         final var current = CoreFunctions.getSubscription();
 * 
 *         var example = new ResourceGroup(&#34;example&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var my_board = new Dashboard(&#34;my-board&#34;, DashboardArgs.builder()        
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .tags(Map.of(&#34;source&#34;, &#34;managed&#34;))
 *             .dashboardProperties(&#34;&#34;&#34;
 * {
 *    &#34;lenses&#34;: {
 *         &#34;0&#34;: {
 *             &#34;order&#34;: 0,
 *             &#34;parts&#34;: {
 *                 &#34;0&#34;: {
 *                     &#34;position&#34;: {
 *                         &#34;x&#34;: 0,
 *                         &#34;y&#34;: 0,
 *                         &#34;rowSpan&#34;: 2,
 *                         &#34;colSpan&#34;: 3
 *                     },
 *                     &#34;metadata&#34;: {
 *                         &#34;inputs&#34;: [],
 *                         &#34;type&#34;: &#34;Extension/HubsExtension/PartType/MarkdownPart&#34;,
 *                         &#34;settings&#34;: {
 *                             &#34;content&#34;: {
 *                                 &#34;settings&#34;: {
 *                                     &#34;content&#34;: &#34;%s&#34;,
 *                                     &#34;subtitle&#34;: &#34;&#34;,
 *                                     &#34;title&#34;: &#34;&#34;
 *                                 }
 *                             }
 *                         }
 *                     }
 *                 },               
 *                 &#34;1&#34;: {
 *                     &#34;position&#34;: {
 *                         &#34;x&#34;: 5,
 *                         &#34;y&#34;: 0,
 *                         &#34;rowSpan&#34;: 4,
 *                         &#34;colSpan&#34;: 6
 *                     },
 *                     &#34;metadata&#34;: {
 *                         &#34;inputs&#34;: [],
 *                         &#34;type&#34;: &#34;Extension/HubsExtension/PartType/VideoPart&#34;,
 *                         &#34;settings&#34;: {
 *                             &#34;content&#34;: {
 *                                 &#34;settings&#34;: {
 *                                     &#34;title&#34;: &#34;Important Information&#34;,
 *                                     &#34;subtitle&#34;: &#34;&#34;,
 *                                     &#34;src&#34;: &#34;%s&#34;,
 *                                     &#34;autoplay&#34;: true
 *                                 }
 *                             }
 *                         }
 *                     }
 *                 },
 *                 &#34;2&#34;: {
 *                     &#34;position&#34;: {
 *                         &#34;x&#34;: 0,
 *                         &#34;y&#34;: 4,
 *                         &#34;rowSpan&#34;: 4,
 *                         &#34;colSpan&#34;: 6
 *                     },
 *                     &#34;metadata&#34;: {
 *                         &#34;inputs&#34;: [
 *                             {
 *                                 &#34;name&#34;: &#34;ComponentId&#34;,
 *                                 &#34;value&#34;: &#34;/subscriptions/%s/resourceGroups/myRG/providers/microsoft.insights/components/myWebApp&#34;
 *                             }
 *                         ],
 *                         &#34;type&#34;: &#34;Extension/AppInsightsExtension/PartType/AppMapGalPt&#34;,
 *                         &#34;settings&#34;: {},
 *                         &#34;asset&#34;: {
 *                             &#34;idInputName&#34;: &#34;ComponentId&#34;,
 *                             &#34;type&#34;: &#34;ApplicationInsights&#34;
 *                         }
 *                     }
 *                 }              
 *             }
 *         }
 *     },
 *     &#34;metadata&#34;: {
 *         &#34;model&#34;: {
 *             &#34;timeRange&#34;: {
 *                 &#34;value&#34;: {
 *                     &#34;relative&#34;: {
 *                         &#34;duration&#34;: 24,
 *                         &#34;timeUnit&#34;: 1
 *                     }
 *                 },
 *                 &#34;type&#34;: &#34;MsPortalFx.Composition.Configuration.ValueTypes.TimeRange&#34;
 *             },
 *             &#34;filterLocale&#34;: {
 *                 &#34;value&#34;: &#34;en-us&#34;
 *             },
 *             &#34;filters&#34;: {
 *                 &#34;value&#34;: {
 *                     &#34;MsPortalFx_TimeRange&#34;: {
 *                         &#34;model&#34;: {
 *                             &#34;format&#34;: &#34;utc&#34;,
 *                             &#34;granularity&#34;: &#34;auto&#34;,
 *                             &#34;relative&#34;: &#34;24h&#34;
 *                         },
 *                         &#34;displayCache&#34;: {
 *                             &#34;name&#34;: &#34;UTC Time&#34;,
 *                             &#34;value&#34;: &#34;Past 24 hours&#34;
 *                         },
 *                         &#34;filteredPartIds&#34;: [
 *                             &#34;StartboardPart-UnboundPart-ae44fef5-76b8-46b0-86f0-2b3f47bad1c7&#34;
 *                         ]
 *                     }
 *                 }
 *             }
 *         }
 *     }
 * }
 * &#34;, mdContent,videoLink,current.applyValue(getSubscriptionResult -&gt; getSubscriptionResult.subscriptionId())))
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * It is recommended to follow the steps outlined
 * [here](https://docs.microsoft.com/azure/azure-portal/azure-portal-dashboards-create-programmatically#fetch-the-json-representation-of-the-dashboard) to create a Dashboard in the Portal and extract the relevant JSON to use in this resource. From the extracted JSON, the contents of the `properties: {}` object can used. Variables can be injected as needed - see above example.
 * 
 * ## Import
 * 
 * Dashboards can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:portal/dashboard:Dashboard my-board /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Portal/dashboards/00000000-0000-0000-0000-000000000000
 * ```
 * 
 *  Note the URI in the above sample can be found using the Resource Explorer tool in the Azure Portal.
 * 
 */
@ResourceType(type="azure:portal/dashboard:Dashboard")
public class Dashboard extends com.pulumi.resources.CustomResource {
    /**
     * JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
     * 
     */
    @Export(name="dashboardProperties", refs={String.class}, tree="[0]")
    private Output<String> dashboardProperties;

    /**
     * @return JSON data representing dashboard body. See above for details on how to obtain this from the Portal.
     * 
     */
    public Output<String> dashboardProperties() {
        return this.dashboardProperties;
    }
    /**
     * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="location", refs={String.class}, tree="[0]")
    private Output<String> location;

    /**
     * @return Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * Specifies the name of the Shared Dashboard. Changing this forces a new resource to be created.
     * 
     * &gt; **Note**: You can specify a tag with the key `hidden-title` to set a more user-friendly title for this Dashboard.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return Specifies the name of the Shared Dashboard. Changing this forces a new resource to be created.
     * 
     * &gt; **Note**: You can specify a tag with the key `hidden-title` to set a more user-friendly title for this Dashboard.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The name of the resource group in which to create the dashboard. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="resourceGroupName", refs={String.class}, tree="[0]")
    private Output<String> resourceGroupName;

    /**
     * @return The name of the resource group in which to create the dashboard. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * A mapping of tags to assign to the resource.
     * 
     */
    @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output</* @Nullable */ Map<String,String>> tags;

    /**
     * @return A mapping of tags to assign to the resource.
     * 
     */
    public Output<Optional<Map<String,String>>> tags() {
        return Codegen.optional(this.tags);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public Dashboard(String name) {
        this(name, DashboardArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public Dashboard(String name, DashboardArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public Dashboard(String name, DashboardArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:portal/dashboard:Dashboard", name, args == null ? DashboardArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private Dashboard(String name, Output<String> id, @Nullable DashboardState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:portal/dashboard:Dashboard", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .aliases(List.of(
                Output.of(Alias.builder().type("azure:dashboard/dashboard:Dashboard").build())
            ))
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static Dashboard get(String name, Output<String> id, @Nullable DashboardState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new Dashboard(name, id, state, options);
    }
}
