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

import com.pulumi.azure.Utilities;
import com.pulumi.azure.network.TrafficManagerAzureEndpointArgs;
import com.pulumi.azure.network.inputs.TrafficManagerAzureEndpointState;
import com.pulumi.azure.network.outputs.TrafficManagerAzureEndpointCustomHeader;
import com.pulumi.azure.network.outputs.TrafficManagerAzureEndpointSubnet;
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.Optional;
import javax.annotation.Nullable;

/**
 * Manages an Azure Endpoint within a Traffic Manager Profile.
 * 
 * ## 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.network.PublicIp;
 * import com.pulumi.azure.network.PublicIpArgs;
 * import com.pulumi.azure.network.TrafficManagerProfile;
 * import com.pulumi.azure.network.TrafficManagerProfileArgs;
 * import com.pulumi.azure.network.inputs.TrafficManagerProfileDnsConfigArgs;
 * import com.pulumi.azure.network.inputs.TrafficManagerProfileMonitorConfigArgs;
 * import com.pulumi.azure.network.TrafficManagerAzureEndpoint;
 * import com.pulumi.azure.network.TrafficManagerAzureEndpointArgs;
 * 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 examplePublicIp = new PublicIp(&#34;examplePublicIp&#34;, PublicIpArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .allocationMethod(&#34;Static&#34;)
 *             .domainNameLabel(&#34;example-public-ip&#34;)
 *             .build());
 * 
 *         var exampleTrafficManagerProfile = new TrafficManagerProfile(&#34;exampleTrafficManagerProfile&#34;, TrafficManagerProfileArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .trafficRoutingMethod(&#34;Weighted&#34;)
 *             .dnsConfig(TrafficManagerProfileDnsConfigArgs.builder()
 *                 .relativeName(&#34;example-profile&#34;)
 *                 .ttl(100)
 *                 .build())
 *             .monitorConfig(TrafficManagerProfileMonitorConfigArgs.builder()
 *                 .protocol(&#34;HTTP&#34;)
 *                 .port(80)
 *                 .path(&#34;/&#34;)
 *                 .intervalInSeconds(30)
 *                 .timeoutInSeconds(9)
 *                 .toleratedNumberOfFailures(3)
 *                 .build())
 *             .tags(Map.of(&#34;environment&#34;, &#34;Production&#34;))
 *             .build());
 * 
 *         var exampleTrafficManagerAzureEndpoint = new TrafficManagerAzureEndpoint(&#34;exampleTrafficManagerAzureEndpoint&#34;, TrafficManagerAzureEndpointArgs.builder()        
 *             .profileId(exampleTrafficManagerProfile.id())
 *             .weight(100)
 *             .targetResourceId(examplePublicIp.id())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Azure Endpoints can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:network/trafficManagerAzureEndpoint:TrafficManagerAzureEndpoint example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.Network/trafficManagerProfiles/example-profile/AzureEndpoints/example-endpoint
 * ```
 * 
 */
@ResourceType(type="azure:network/trafficManagerAzureEndpoint:TrafficManagerAzureEndpoint")
public class TrafficManagerAzureEndpoint extends com.pulumi.resources.CustomResource {
    /**
     * One or more `custom_header` blocks as defined below.
     * 
     */
    @Export(name="customHeaders", refs={List.class,TrafficManagerAzureEndpointCustomHeader.class}, tree="[0,1]")
    private Output</* @Nullable */ List<TrafficManagerAzureEndpointCustomHeader>> customHeaders;

    /**
     * @return One or more `custom_header` blocks as defined below.
     * 
     */
    public Output<Optional<List<TrafficManagerAzureEndpointCustomHeader>>> customHeaders() {
        return Codegen.optional(this.customHeaders);
    }
    /**
     * Is the endpoint enabled? Defaults to `true`.
     * 
     */
    @Export(name="enabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> enabled;

    /**
     * @return Is the endpoint enabled? Defaults to `true`.
     * 
     */
    public Output<Optional<Boolean>> enabled() {
        return Codegen.optional(this.enabled);
    }
    /**
     * A list of Geographic Regions used to distribute traffic, such as `WORLD`, `UK` or `DE`. The same location can&#39;t be specified in two endpoints. [See the Geographic Hierarchies documentation for more information](https://docs.microsoft.com/rest/api/trafficmanager/geographichierarchies/getdefault).
     * 
     */
    @Export(name="geoMappings", refs={List.class,String.class}, tree="[0,1]")
    private Output</* @Nullable */ List<String>> geoMappings;

    /**
     * @return A list of Geographic Regions used to distribute traffic, such as `WORLD`, `UK` or `DE`. The same location can&#39;t be specified in two endpoints. [See the Geographic Hierarchies documentation for more information](https://docs.microsoft.com/rest/api/trafficmanager/geographichierarchies/getdefault).
     * 
     */
    public Output<Optional<List<String>>> geoMappings() {
        return Codegen.optional(this.geoMappings);
    }
    /**
     * The name of the Azure Endpoint. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return The name of the Azure Endpoint. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * Specifies the priority of this Endpoint, this must be specified for Profiles using the `Priority` traffic routing method. Supports values between 1 and 1000, with no Endpoints sharing the same value. If omitted the value will be computed in order of creation.
     * 
     */
    @Export(name="priority", refs={Integer.class}, tree="[0]")
    private Output<Integer> priority;

    /**
     * @return Specifies the priority of this Endpoint, this must be specified for Profiles using the `Priority` traffic routing method. Supports values between 1 and 1000, with no Endpoints sharing the same value. If omitted the value will be computed in order of creation.
     * 
     */
    public Output<Integer> priority() {
        return this.priority;
    }
    /**
     * The ID of the Traffic Manager Profile that this Azure Endpoint should be created within. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="profileId", refs={String.class}, tree="[0]")
    private Output<String> profileId;

    /**
     * @return The ID of the Traffic Manager Profile that this Azure Endpoint should be created within. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> profileId() {
        return this.profileId;
    }
    /**
     * One or more `subnet` blocks as defined below. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="subnets", refs={List.class,TrafficManagerAzureEndpointSubnet.class}, tree="[0,1]")
    private Output</* @Nullable */ List<TrafficManagerAzureEndpointSubnet>> subnets;

    /**
     * @return One or more `subnet` blocks as defined below. Changing this forces a new resource to be created.
     * 
     */
    public Output<Optional<List<TrafficManagerAzureEndpointSubnet>>> subnets() {
        return Codegen.optional(this.subnets);
    }
    /**
     * The ID of the Azure Resource which should be used as a target.
     * 
     */
    @Export(name="targetResourceId", refs={String.class}, tree="[0]")
    private Output<String> targetResourceId;

    /**
     * @return The ID of the Azure Resource which should be used as a target.
     * 
     */
    public Output<String> targetResourceId() {
        return this.targetResourceId;
    }
    /**
     * Specifies how much traffic should be distributed to this endpoint, this must be specified for Profiles using the Weighted traffic routing method. Valid values are between `1` and `1000`.
     * 
     */
    @Export(name="weight", refs={Integer.class}, tree="[0]")
    private Output<Integer> weight;

    /**
     * @return Specifies how much traffic should be distributed to this endpoint, this must be specified for Profiles using the Weighted traffic routing method. Valid values are between `1` and `1000`.
     * 
     */
    public Output<Integer> weight() {
        return this.weight;
    }

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

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