"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.WebTest = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an Application Insights WebTest.
 *
 * > **Note:** Despite the discrepancy in its name, this Terraform resource corresponds to the Azure resource 'Application Insights Classic Web Test'. Azure changed the name, but we retained the original name in Terraform to avoid disruption and ensure backward compatibility.
 *
 * ## 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 exampleWebTest = new azure.appinsights.WebTest("example", {
 *     name: "tf-test-appinsights-webtest",
 *     location: exampleInsights.location,
 *     resourceGroupName: example.name,
 *     applicationInsightsId: exampleInsights.id,
 *     kind: "ping",
 *     frequency: 300,
 *     timeout: 60,
 *     enabled: true,
 *     geoLocations: [
 *         "us-tx-sn1-azr",
 *         "us-il-ch1-azr",
 *     ],
 *     configuration: `<WebTest Name=\\"WebTest1\\" Id=\\"ABD48585-0831-40CB-9069-682EA6BB3583\\" Enabled=\\"True\\" CssProjectStructure=\\"\\" CssIteration=\\"\\" Timeout=\\"0\\" WorkItemIds=\\"\\" xmlns=\\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\\" Description=\\"\\" CredentialUserName=\\"\\" CredentialPassword=\\"\\" PreAuthenticate=\\"True\\" Proxy=\\"default\\" StopOnError=\\"False\\" RecordedResultFile=\\"\\" ResultsLocale=\\"\\">
 *   <Items>
 *     <Request Method=\\"GET\\" Guid=\\"a5f10126-e4cd-570d-961c-cea43999a200\\" Version=\\"1.1\\" Url=\\"http://microsoft.com\\" ThinkTime=\\"0\\" Timeout=\\"300\\" ParseDependentRequests=\\"True\\" FollowRedirects=\\"True\\" RecordResult=\\"True\\" Cache=\\"False\\" ResponseTimeGoal=\\"0\\" Encoding=\\"utf-8\\" ExpectedHttpStatusCode=\\"200\\" ExpectedResponseUrl=\\"\\" ReportingName=\\"\\" IgnoreHttpStatusCode=\\"False\\" />
 *   </Items>
 * </WebTest>
 * `,
 * });
 * export const webtestId = exampleWebTest.id;
 * export const webtestsSyntheticId = exampleWebTest.syntheticMonitorId;
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Insights` - 2022-06-15
 *
 * ## Import
 *
 * Application Insights Web Tests can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:appinsights/webTest:WebTest my_test /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Insights/webTests/my_test
 * ```
 */
class WebTest extends pulumi.CustomResource {
    /**
     * Get an existing WebTest 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 WebTest(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:appinsights/webTest:WebTest';
    /**
     * Returns true if the given object is an instance of WebTest.  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'] === WebTest.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["applicationInsightsId"] = state?.applicationInsightsId;
            resourceInputs["configuration"] = state?.configuration;
            resourceInputs["description"] = state?.description;
            resourceInputs["enabled"] = state?.enabled;
            resourceInputs["frequency"] = state?.frequency;
            resourceInputs["geoLocations"] = state?.geoLocations;
            resourceInputs["kind"] = state?.kind;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["retryEnabled"] = state?.retryEnabled;
            resourceInputs["syntheticMonitorId"] = state?.syntheticMonitorId;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["timeout"] = state?.timeout;
        }
        else {
            const args = argsOrState;
            if (args?.applicationInsightsId === undefined && !opts.urn) {
                throw new Error("Missing required property 'applicationInsightsId'");
            }
            if (args?.configuration === undefined && !opts.urn) {
                throw new Error("Missing required property 'configuration'");
            }
            if (args?.geoLocations === undefined && !opts.urn) {
                throw new Error("Missing required property 'geoLocations'");
            }
            if (args?.kind === undefined && !opts.urn) {
                throw new Error("Missing required property 'kind'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            resourceInputs["applicationInsightsId"] = args?.applicationInsightsId;
            resourceInputs["configuration"] = args?.configuration;
            resourceInputs["description"] = args?.description;
            resourceInputs["enabled"] = args?.enabled;
            resourceInputs["frequency"] = args?.frequency;
            resourceInputs["geoLocations"] = args?.geoLocations;
            resourceInputs["kind"] = args?.kind;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["retryEnabled"] = args?.retryEnabled;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["timeout"] = args?.timeout;
            resourceInputs["syntheticMonitorId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(WebTest.__pulumiType, name, resourceInputs, opts);
    }
}
exports.WebTest = WebTest;
//# sourceMappingURL=webTest.js.map