"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AnalyticsItem = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an Application Insights Analytics Item component.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "tf-test",
 *     location: "West Europe",
 * });
 * const exampleInsights = new azure.appinsights.Insights("example", {
 *     name: "tf-test-appinsights",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     applicationType: "web",
 * });
 * const exampleAnalyticsItem = new azure.appinsights.AnalyticsItem("example", {
 *     name: "testquery",
 *     applicationInsightsId: exampleInsights.id,
 *     content: "requests //simple example query",
 *     scope: "shared",
 *     type: "query",
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Insights` - 2015-05-01
 *
 * ## 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
 * ```
 *
 * > **Please Note:** This is a provider Unique ID matching the format: `{appInsightsID}/analyticsItems/{itemId}` for items with `scope` set to `shared`, or  `{appInsightsID}/myAnalyticsItems/{itemId}` for items with `scope` set to `user`
 *
 * 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.
 *
 * ```sh
 * az rest --method GET --uri "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/microsoft.insights/components/appinsightstest/analyticsItems?api-version=2015-05-01"
 * ```
 */
class AnalyticsItem extends pulumi.CustomResource {
    /**
     * Get an existing AnalyticsItem 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 Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new AnalyticsItem(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:appinsights/analyticsItem:AnalyticsItem';
    /**
     * Returns true if the given object is an instance of AnalyticsItem.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === AnalyticsItem.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["applicationInsightsId"] = state?.applicationInsightsId;
            resourceInputs["content"] = state?.content;
            resourceInputs["functionAlias"] = state?.functionAlias;
            resourceInputs["name"] = state?.name;
            resourceInputs["scope"] = state?.scope;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["timeModified"] = state?.timeModified;
            resourceInputs["type"] = state?.type;
            resourceInputs["version"] = state?.version;
        }
        else {
            const args = argsOrState;
            if (args?.applicationInsightsId === undefined && !opts.urn) {
                throw new Error("Missing required property 'applicationInsightsId'");
            }
            if (args?.content === undefined && !opts.urn) {
                throw new Error("Missing required property 'content'");
            }
            if (args?.scope === undefined && !opts.urn) {
                throw new Error("Missing required property 'scope'");
            }
            if (args?.type === undefined && !opts.urn) {
                throw new Error("Missing required property 'type'");
            }
            resourceInputs["applicationInsightsId"] = args?.applicationInsightsId;
            resourceInputs["content"] = args?.content;
            resourceInputs["functionAlias"] = args?.functionAlias;
            resourceInputs["name"] = args?.name;
            resourceInputs["scope"] = args?.scope;
            resourceInputs["type"] = args?.type;
            resourceInputs["timeCreated"] = undefined /*out*/;
            resourceInputs["timeModified"] = undefined /*out*/;
            resourceInputs["version"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(AnalyticsItem.__pulumiType, name, resourceInputs, opts);
    }
}
exports.AnalyticsItem = AnalyticsItem;
//# sourceMappingURL=analyticsItem.js.map