// *** 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.WebTestArgs;
import com.pulumi.azure.appinsights.inputs.WebTestState;
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.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages an Application Insights WebTest.
 * 
 * ## 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.WebTest;
 * import com.pulumi.azure.appinsights.WebTestArgs;
 * 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 exampleWebTest = new WebTest(&#34;exampleWebTest&#34;, WebTestArgs.builder()        
 *             .location(exampleInsights.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .applicationInsightsId(exampleInsights.id())
 *             .kind(&#34;ping&#34;)
 *             .frequency(300)
 *             .timeout(60)
 *             .enabled(true)
 *             .geoLocations(            
 *                 &#34;us-tx-sn1-azr&#34;,
 *                 &#34;us-il-ch1-azr&#34;)
 *             .configuration(&#34;&#34;&#34;
 * &lt;WebTest Name=&#34;WebTest1&#34; Id=&#34;ABD48585-0831-40CB-9069-682EA6BB3583&#34; Enabled=&#34;True&#34; CssProjectStructure=&#34;&#34; CssIteration=&#34;&#34; Timeout=&#34;0&#34; WorkItemIds=&#34;&#34; xmlns=&#34;http://microsoft.com/schemas/VisualStudio/TeamTest/2010&#34; Description=&#34;&#34; CredentialUserName=&#34;&#34; CredentialPassword=&#34;&#34; PreAuthenticate=&#34;True&#34; Proxy=&#34;default&#34; StopOnError=&#34;False&#34; RecordedResultFile=&#34;&#34; ResultsLocale=&#34;&#34;&gt;
 *   &lt;Items&gt;
 *     &lt;Request Method=&#34;GET&#34; Guid=&#34;a5f10126-e4cd-570d-961c-cea43999a200&#34; Version=&#34;1.1&#34; Url=&#34;http://microsoft.com&#34; ThinkTime=&#34;0&#34; Timeout=&#34;300&#34; ParseDependentRequests=&#34;True&#34; FollowRedirects=&#34;True&#34; RecordResult=&#34;True&#34; Cache=&#34;False&#34; ResponseTimeGoal=&#34;0&#34; Encoding=&#34;utf-8&#34; ExpectedHttpStatusCode=&#34;200&#34; ExpectedResponseUrl=&#34;&#34; ReportingName=&#34;&#34; IgnoreHttpStatusCode=&#34;False&#34; /&gt;
 *   &lt;/Items&gt;
 * &lt;/WebTest&gt;
 *             &#34;&#34;&#34;)
 *             .build());
 * 
 *         ctx.export(&#34;webtestId&#34;, exampleWebTest.id());
 *         ctx.export(&#34;webtestsSyntheticId&#34;, exampleWebTest.syntheticMonitorId());
 *     }
 * }
 * ```
 * 
 * ## 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
 * ```
 * 
 */
@ResourceType(type="azure:appinsights/webTest:WebTest")
public class WebTest extends com.pulumi.resources.CustomResource {
    /**
     * The ID of the Application Insights component on which the WebTest operates. 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 WebTest operates. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> applicationInsightsId() {
        return this.applicationInsightsId;
    }
    /**
     * An XML configuration specification for a WebTest ([see here for more information](https://docs.microsoft.com/rest/api/application-insights/webtests/createorupdate/)).
     * 
     */
    @Export(name="configuration", refs={String.class}, tree="[0]")
    private Output<String> configuration;

    /**
     * @return An XML configuration specification for a WebTest ([see here for more information](https://docs.microsoft.com/rest/api/application-insights/webtests/createorupdate/)).
     * 
     */
    public Output<String> configuration() {
        return this.configuration;
    }
    /**
     * Purpose/user defined descriptive test for this WebTest.
     * 
     */
    @Export(name="description", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> description;

    /**
     * @return Purpose/user defined descriptive test for this WebTest.
     * 
     */
    public Output<Optional<String>> description() {
        return Codegen.optional(this.description);
    }
    /**
     * Is the test actively being monitored.
     * 
     */
    @Export(name="enabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> enabled;

    /**
     * @return Is the test actively being monitored.
     * 
     */
    public Output<Optional<Boolean>> enabled() {
        return Codegen.optional(this.enabled);
    }
    /**
     * Interval in seconds between test runs for this WebTest. Valid options are `300`, `600` and `900`. Defaults to `300`.
     * 
     */
    @Export(name="frequency", refs={Integer.class}, tree="[0]")
    private Output</* @Nullable */ Integer> frequency;

    /**
     * @return Interval in seconds between test runs for this WebTest. Valid options are `300`, `600` and `900`. Defaults to `300`.
     * 
     */
    public Output<Optional<Integer>> frequency() {
        return Codegen.optional(this.frequency);
    }
    /**
     * A list of where to physically run the tests from to give global coverage for accessibility of your application.
     * 
     * &gt; **Note:** [Valid options for geo locations are described here](https://docs.microsoft.com/azure/azure-monitor/app/monitor-web-app-availability#location-population-tags)
     * 
     */
    @Export(name="geoLocations", refs={List.class,String.class}, tree="[0,1]")
    private Output<List<String>> geoLocations;

    /**
     * @return A list of where to physically run the tests from to give global coverage for accessibility of your application.
     * 
     * &gt; **Note:** [Valid options for geo locations are described here](https://docs.microsoft.com/azure/azure-monitor/app/monitor-web-app-availability#location-population-tags)
     * 
     */
    public Output<List<String>> geoLocations() {
        return this.geoLocations;
    }
    /**
     * The kind of web test that this web test watches. Choices are `ping` and `multistep`. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="kind", refs={String.class}, tree="[0]")
    private Output<String> kind;

    /**
     * @return The kind of web test that this web test watches. Choices are `ping` and `multistep`. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> kind() {
        return this.kind;
    }
    /**
     * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. It needs to correlate with location of parent resource (azurerm_application_insights).
     * 
     */
    @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. It needs to correlate with location of parent resource (azurerm_application_insights).
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * Specifies the name of the Application Insights WebTest. 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 WebTest. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The name of the resource group in which to create the Application Insights WebTest. Changing this forces a new resource
     * 
     */
    @Export(name="resourceGroupName", refs={String.class}, tree="[0]")
    private Output<String> resourceGroupName;

    /**
     * @return The name of the resource group in which to create the Application Insights WebTest. Changing this forces a new resource
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * Allow for retries should this WebTest fail.
     * 
     */
    @Export(name="retryEnabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> retryEnabled;

    /**
     * @return Allow for retries should this WebTest fail.
     * 
     */
    public Output<Optional<Boolean>> retryEnabled() {
        return Codegen.optional(this.retryEnabled);
    }
    @Export(name="syntheticMonitorId", refs={String.class}, tree="[0]")
    private Output<String> syntheticMonitorId;

    public Output<String> syntheticMonitorId() {
        return this.syntheticMonitorId;
    }
    /**
     * 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);
    }
    /**
     * Seconds until this WebTest will timeout and fail. Default is `30`.
     * 
     */
    @Export(name="timeout", refs={Integer.class}, tree="[0]")
    private Output</* @Nullable */ Integer> timeout;

    /**
     * @return Seconds until this WebTest will timeout and fail. Default is `30`.
     * 
     */
    public Output<Optional<Integer>> timeout() {
        return Codegen.optional(this.timeout);
    }

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

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