"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.TrafficManagerNestedEndpoint = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Nested Endpoint within a Traffic Manager Profile.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const examplePublicIp = new azure.network.PublicIp("example", {
 *     name: "example-publicip",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     allocationMethod: "Static",
 *     domainNameLabel: "example-pip",
 * });
 * const parent = new azure.network.TrafficManagerProfile("parent", {
 *     name: "parent-profile",
 *     resourceGroupName: example.name,
 *     trafficRoutingMethod: "Weighted",
 *     dnsConfig: {
 *         relativeName: "parent-profile",
 *         ttl: 100,
 *     },
 *     monitorConfig: {
 *         protocol: "HTTP",
 *         port: 80,
 *         path: "/",
 *         intervalInSeconds: 30,
 *         timeoutInSeconds: 9,
 *         toleratedNumberOfFailures: 3,
 *     },
 *     tags: {
 *         environment: "Production",
 *     },
 * });
 * const nested = new azure.network.TrafficManagerProfile("nested", {
 *     name: "nested-profile",
 *     resourceGroupName: example.name,
 *     trafficRoutingMethod: "Priority",
 *     dnsConfig: {
 *         relativeName: "nested-profile",
 *         ttl: 30,
 *     },
 *     monitorConfig: {
 *         protocol: "HTTP",
 *         port: 443,
 *         path: "/",
 *     },
 * });
 * const exampleTrafficManagerNestedEndpoint = new azure.network.TrafficManagerNestedEndpoint("example", {
 *     name: "example-endpoint",
 *     targetResourceId: nested.id,
 *     priority: 1,
 *     profileId: parent.id,
 *     minimumChildEndpoints: 9,
 *     weight: 5,
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Network` - 2022-04-01
 *
 * ## 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
 * ```
 */
class TrafficManagerNestedEndpoint extends pulumi.CustomResource {
    /**
     * Get an existing TrafficManagerNestedEndpoint 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 TrafficManagerNestedEndpoint(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:network/trafficManagerNestedEndpoint:TrafficManagerNestedEndpoint';
    /**
     * Returns true if the given object is an instance of TrafficManagerNestedEndpoint.  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'] === TrafficManagerNestedEndpoint.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["customHeaders"] = state?.customHeaders;
            resourceInputs["enabled"] = state?.enabled;
            resourceInputs["endpointLocation"] = state?.endpointLocation;
            resourceInputs["geoMappings"] = state?.geoMappings;
            resourceInputs["minimumChildEndpoints"] = state?.minimumChildEndpoints;
            resourceInputs["minimumRequiredChildEndpointsIpv4"] = state?.minimumRequiredChildEndpointsIpv4;
            resourceInputs["minimumRequiredChildEndpointsIpv6"] = state?.minimumRequiredChildEndpointsIpv6;
            resourceInputs["name"] = state?.name;
            resourceInputs["priority"] = state?.priority;
            resourceInputs["profileId"] = state?.profileId;
            resourceInputs["subnets"] = state?.subnets;
            resourceInputs["targetResourceId"] = state?.targetResourceId;
            resourceInputs["weight"] = state?.weight;
        }
        else {
            const args = argsOrState;
            if (args?.minimumChildEndpoints === undefined && !opts.urn) {
                throw new Error("Missing required property 'minimumChildEndpoints'");
            }
            if (args?.profileId === undefined && !opts.urn) {
                throw new Error("Missing required property 'profileId'");
            }
            if (args?.targetResourceId === undefined && !opts.urn) {
                throw new Error("Missing required property 'targetResourceId'");
            }
            resourceInputs["customHeaders"] = args?.customHeaders;
            resourceInputs["enabled"] = args?.enabled;
            resourceInputs["endpointLocation"] = args?.endpointLocation;
            resourceInputs["geoMappings"] = args?.geoMappings;
            resourceInputs["minimumChildEndpoints"] = args?.minimumChildEndpoints;
            resourceInputs["minimumRequiredChildEndpointsIpv4"] = args?.minimumRequiredChildEndpointsIpv4;
            resourceInputs["minimumRequiredChildEndpointsIpv6"] = args?.minimumRequiredChildEndpointsIpv6;
            resourceInputs["name"] = args?.name;
            resourceInputs["priority"] = args?.priority;
            resourceInputs["profileId"] = args?.profileId;
            resourceInputs["subnets"] = args?.subnets;
            resourceInputs["targetResourceId"] = args?.targetResourceId;
            resourceInputs["weight"] = args?.weight;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(TrafficManagerNestedEndpoint.__pulumiType, name, resourceInputs, opts);
    }
}
exports.TrafficManagerNestedEndpoint = TrafficManagerNestedEndpoint;
//# sourceMappingURL=trafficManagerNestedEndpoint.js.map