// *** 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.appinsights;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.appinsights.AnalyticsItemArgs;
import com.pulumi.azure.appinsights.inputs.AnalyticsItemState;
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.Optional;
import javax.annotation.Nullable;

/**
 * Manages an Application Insights Analytics Item component.
 * 
 * ## Example Usage
 * ```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.Insights;
 * import com.pulumi.azure.appinsights.InsightsArgs;
 * import com.pulumi.azure.appinsights.AnalyticsItem;
 * import com.pulumi.azure.appinsights.AnalyticsItemArgs;
 * 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 exampleResourceGroup = new ResourceGroup(&#34;exampleResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var exampleInsights = new Insights(&#34;exampleInsights&#34;, InsightsArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .applicationType(&#34;web&#34;)
 *             .build());
 * 
 *         var exampleAnalyticsItem = new AnalyticsItem(&#34;exampleAnalyticsItem&#34;, AnalyticsItemArgs.builder()        
 *             .applicationInsightsId(exampleInsights.id())
 *             .content(&#34;requests //simple example query&#34;)
 *             .scope(&#34;shared&#34;)
 *             .type(&#34;query&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Application Insights Analytics Items can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:appinsights/analyticsItem:AnalyticsItem example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Insights/components/mycomponent1/analyticsItems/11111111-1111-1111-1111-111111111111
 * ```
 * 
 *  To find the Analytics Item ID you can query the REST API using the [`az rest` CLI command](https://docs.microsoft.com/cli/azure/reference-index?view=azure-cli-latest#az-rest), e.g. az rest --method GET --uri &#34;https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/microsoft.insights/components/appinsightstest/analyticsItems?api-version=2015-05-01&#34;
 * 
 */
@ResourceType(type="azure:appinsights/analyticsItem:AnalyticsItem")
public class AnalyticsItem extends com.pulumi.resources.CustomResource {
    /**
     * The ID of the Application Insights component on which the Analytics Item exists. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="applicationInsightsId", refs={String.class}, tree="[0]")
    private Output<String> applicationInsightsId;

    /**
     * @return The ID of the Application Insights component on which the Analytics Item exists. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> applicationInsightsId() {
        return this.applicationInsightsId;
    }
    /**
     * The content for the Analytics Item, for example the query text if `type` is `query`.
     * 
     */
    @Export(name="content", refs={String.class}, tree="[0]")
    private Output<String> content;

    /**
     * @return The content for the Analytics Item, for example the query text if `type` is `query`.
     * 
     */
    public Output<String> content() {
        return this.content;
    }
    /**
     * The alias to use for the function. Required when `type` is `function`.
     * 
     */
    @Export(name="functionAlias", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> functionAlias;

    /**
     * @return The alias to use for the function. Required when `type` is `function`.
     * 
     */
    public Output<Optional<String>> functionAlias() {
        return Codegen.optional(this.functionAlias);
    }
    /**
     * Specifies the name of the Application Insights Analytics Item. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return Specifies the name of the Application Insights Analytics Item. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The scope for the Analytics Item. Can be `shared` or `user`. Changing this forces a new resource to be created. Must be `shared` for functions.
     * 
     */
    @Export(name="scope", refs={String.class}, tree="[0]")
    private Output<String> scope;

    /**
     * @return The scope for the Analytics Item. Can be `shared` or `user`. Changing this forces a new resource to be created. Must be `shared` for functions.
     * 
     */
    public Output<String> scope() {
        return this.scope;
    }
    /**
     * A string containing the time the Analytics Item was created.
     * 
     */
    @Export(name="timeCreated", refs={String.class}, tree="[0]")
    private Output<String> timeCreated;

    /**
     * @return A string containing the time the Analytics Item was created.
     * 
     */
    public Output<String> timeCreated() {
        return this.timeCreated;
    }
    /**
     * A string containing the time the Analytics Item was last modified.
     * 
     */
    @Export(name="timeModified", refs={String.class}, tree="[0]")
    private Output<String> timeModified;

    /**
     * @return A string containing the time the Analytics Item was last modified.
     * 
     */
    public Output<String> timeModified() {
        return this.timeModified;
    }
    /**
     * The type of Analytics Item to create. Can be one of `query`, `function`, `folder`, `recent`. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="type", refs={String.class}, tree="[0]")
    private Output<String> type;

    /**
     * @return The type of Analytics Item to create. Can be one of `query`, `function`, `folder`, `recent`. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> type() {
        return this.type;
    }
    /**
     * A string indicating the version of the query format
     * 
     */
    @Export(name="version", refs={String.class}, tree="[0]")
    private Output<String> version;

    /**
     * @return A string indicating the version of the query format
     * 
     */
    public Output<String> version() {
        return this.version;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public AnalyticsItem(String name) {
        this(name, AnalyticsItemArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public AnalyticsItem(String name, AnalyticsItemArgs 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 AnalyticsItem(String name, AnalyticsItemArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:appinsights/analyticsItem:AnalyticsItem", name, args == null ? AnalyticsItemArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private AnalyticsItem(String name, Output<String> id, @Nullable AnalyticsItemState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:appinsights/analyticsItem:AnalyticsItem", 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())
            .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 AnalyticsItem get(String name, Output<String> id, @Nullable AnalyticsItemState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new AnalyticsItem(name, id, state, options);
    }
}
