// *** 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.TrafficManagerNestedEndpointArgs;
import com.pulumi.azure.network.inputs.TrafficManagerNestedEndpointState;
import com.pulumi.azure.network.outputs.TrafficManagerNestedEndpointCustomHeader;
import com.pulumi.azure.network.outputs.TrafficManagerNestedEndpointSubnet;
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 a Nested 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.TrafficManagerNestedEndpoint;
 * import com.pulumi.azure.network.TrafficManagerNestedEndpointArgs;
 * 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-pip&#34;)
 *             .build());
 * 
 *         var parent = new TrafficManagerProfile(&#34;parent&#34;, TrafficManagerProfileArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .trafficRoutingMethod(&#34;Weighted&#34;)
 *             .dnsConfig(TrafficManagerProfileDnsConfigArgs.builder()
 *                 .relativeName(&#34;parent-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 nested = new TrafficManagerProfile(&#34;nested&#34;, TrafficManagerProfileArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .trafficRoutingMethod(&#34;Priority&#34;)
 *             .dnsConfig(TrafficManagerProfileDnsConfigArgs.builder()
 *                 .relativeName(&#34;nested-profile&#34;)
 *                 .ttl(30)
 *                 .build())
 *             .monitorConfig(TrafficManagerProfileMonitorConfigArgs.builder()
 *                 .protocol(&#34;HTTP&#34;)
 *                 .port(443)
 *                 .path(&#34;/&#34;)
 *                 .build())
 *             .build());
 * 
 *         var exampleTrafficManagerNestedEndpoint = new TrafficManagerNestedEndpoint(&#34;exampleTrafficManagerNestedEndpoint&#34;, TrafficManagerNestedEndpointArgs.builder()        
 *             .targetResourceId(nested.id())
 *             .priority(1)
 *             .profileId(parent.id())
 *             .minimumChildEndpoints(9)
 *             .weight(5)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Nested Endpoints can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:network/trafficManagerNestedEndpoint:TrafficManagerNestedEndpoint example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.Network/trafficManagerProfiles/example-profile/NestedEndpoints/example-endpoint
 * ```
 * 
 */
@ResourceType(type="azure:network/trafficManagerNestedEndpoint:TrafficManagerNestedEndpoint")
public class TrafficManagerNestedEndpoint extends com.pulumi.resources.CustomResource {
    /**
     * One or more `custom_header` blocks as defined below.
     * 
     */
    @Export(name="customHeaders", refs={List.class,TrafficManagerNestedEndpointCustomHeader.class}, tree="[0,1]")
    private Output</* @Nullable */ List<TrafficManagerNestedEndpointCustomHeader>> customHeaders;

    /**
     * @return One or more `custom_header` blocks as defined below.
     * 
     */
    public Output<Optional<List<TrafficManagerNestedEndpointCustomHeader>>> 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);
    }
    /**
     * Specifies the Azure location of the Endpoint, this must be specified for Profiles using the `Performance` routing method.
     * 
     */
    @Export(name="endpointLocation", refs={String.class}, tree="[0]")
    private Output<String> endpointLocation;

    /**
     * @return Specifies the Azure location of the Endpoint, this must be specified for Profiles using the `Performance` routing method.
     * 
     */
    public Output<String> endpointLocation() {
        return this.endpointLocation;
    }
    /**
     * 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);
    }
    /**
     * This argument specifies the minimum number of endpoints that must be ‘online’ in the child profile in order for the parent profile to direct traffic to any of the endpoints in that child profile. This value must be larger than `0`.
     * 
     * ~&gt;**NOTE:** If `min_child_endpoints` is less than either `minimum_required_child_endpoints_ipv4` or `minimum_required_child_endpoints_ipv6`, then it won&#39;t have any effect.
     * 
     */
    @Export(name="minimumChildEndpoints", refs={Integer.class}, tree="[0]")
    private Output<Integer> minimumChildEndpoints;

    /**
     * @return This argument specifies the minimum number of endpoints that must be ‘online’ in the child profile in order for the parent profile to direct traffic to any of the endpoints in that child profile. This value must be larger than `0`.
     * 
     * ~&gt;**NOTE:** If `min_child_endpoints` is less than either `minimum_required_child_endpoints_ipv4` or `minimum_required_child_endpoints_ipv6`, then it won&#39;t have any effect.
     * 
     */
    public Output<Integer> minimumChildEndpoints() {
        return this.minimumChildEndpoints;
    }
    /**
     * This argument specifies the minimum number of IPv4 (DNS record type A) endpoints that must be ‘online’ in the child profile in order for the parent profile to direct traffic to any of the endpoints in that child profile. This argument only applies to Endpoints of type `nestedEndpoints` and
     * 
     */
    @Export(name="minimumRequiredChildEndpointsIpv4", refs={Integer.class}, tree="[0]")
    private Output</* @Nullable */ Integer> minimumRequiredChildEndpointsIpv4;

    /**
     * @return This argument specifies the minimum number of IPv4 (DNS record type A) endpoints that must be ‘online’ in the child profile in order for the parent profile to direct traffic to any of the endpoints in that child profile. This argument only applies to Endpoints of type `nestedEndpoints` and
     * 
     */
    public Output<Optional<Integer>> minimumRequiredChildEndpointsIpv4() {
        return Codegen.optional(this.minimumRequiredChildEndpointsIpv4);
    }
    /**
     * This argument specifies the minimum number of IPv6 (DNS record type AAAA) endpoints that must be ‘online’ in the child profile in order for the parent profile to direct traffic to any of the endpoints in that child profile. This argument only applies to Endpoints of type `nestedEndpoints` and
     * 
     */
    @Export(name="minimumRequiredChildEndpointsIpv6", refs={Integer.class}, tree="[0]")
    private Output</* @Nullable */ Integer> minimumRequiredChildEndpointsIpv6;

    /**
     * @return This argument specifies the minimum number of IPv6 (DNS record type AAAA) endpoints that must be ‘online’ in the child profile in order for the parent profile to direct traffic to any of the endpoints in that child profile. This argument only applies to Endpoints of type `nestedEndpoints` and
     * 
     */
    public Output<Optional<Integer>> minimumRequiredChildEndpointsIpv6() {
        return Codegen.optional(this.minimumRequiredChildEndpointsIpv6);
    }
    /**
     * The name of the External 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 External 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 External 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 External 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,TrafficManagerNestedEndpointSubnet.class}, tree="[0,1]")
    private Output</* @Nullable */ List<TrafficManagerNestedEndpointSubnet>> subnets;

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

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

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