"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.EndpointCustomDomain = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Custom Domain for a CDN (classic) Endpoint.
 *
 * !> **Note:** Support for the CDN (classic) `sku` `Standard_Akamai` was deprecated from Azure on `October 31, 2023` and is no longer available.
 *
 * !> **Note:** Support for the CDN (classic) `sku` values `Standard_Verizon` and `Premium_Verizon` were deprecated from Azure on `January 15, 2025` and are no longer available.
 *
 * !> **Note:** Support for the CDN (classic) `sku` values `Standard_Microsoft` and `Standard_ChinaCdn` will be deprecated from Azure on `October 1, 2025` and will no longer be available, however, modifications to existing CDN (classic) resources will continue to be supported until the API reaches full retirement on `September 30, 2027`.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const exampleResourceGroup = new azure.core.ResourceGroup("example", {
 *     name: "example-rg",
 *     location: "west europe",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "example",
 *     resourceGroupName: exampleResourceGroup.name,
 *     location: exampleResourceGroup.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "GRS",
 * });
 * const exampleProfile = new azure.cdn.Profile("example", {
 *     name: "example-profile",
 *     location: exampleResourceGroup.location,
 *     resourceGroupName: exampleResourceGroup.name,
 *     sku: "Standard_Microsoft",
 * });
 * const exampleEndpoint = new azure.cdn.Endpoint("example", {
 *     name: "example-endpoint",
 *     profileName: exampleProfile.name,
 *     location: exampleResourceGroup.location,
 *     resourceGroupName: exampleResourceGroup.name,
 *     origins: [{
 *         name: "example",
 *         hostName: exampleAccount.primaryBlobHost,
 *     }],
 * });
 * const example = azure.dns.getZone({
 *     name: "example-domain.com",
 *     resourceGroupName: "domain-rg",
 * });
 * const exampleCNameRecord = new azure.dns.CNameRecord("example", {
 *     name: "example",
 *     zoneName: example.then(example => example.name),
 *     resourceGroupName: example.then(example => example.resourceGroupName),
 *     ttl: 3600,
 *     targetResourceId: exampleEndpoint.id,
 * });
 * const exampleEndpointCustomDomain = new azure.cdn.EndpointCustomDomain("example", {
 *     name: "example-domain",
 *     cdnEndpointId: exampleEndpoint.id,
 *     hostName: Promise.all([exampleCNameRecord.name, example]).then(([name, example]) => `${name}.${example.name}`),
 * });
 * ```
 *
 * ## Import
 *
 * CDN Endpoint Custom Domains can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:cdn/endpointCustomDomain:EndpointCustomDomain example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Cdn/profiles/profile1/endpoints/endpoint1/customDomains/domain1
 * ```
 */
class EndpointCustomDomain extends pulumi.CustomResource {
    /**
     * Get an existing EndpointCustomDomain 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 EndpointCustomDomain(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:cdn/endpointCustomDomain:EndpointCustomDomain';
    /**
     * Returns true if the given object is an instance of EndpointCustomDomain.  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'] === EndpointCustomDomain.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["cdnEndpointId"] = state?.cdnEndpointId;
            resourceInputs["cdnManagedHttps"] = state?.cdnManagedHttps;
            resourceInputs["hostName"] = state?.hostName;
            resourceInputs["name"] = state?.name;
            resourceInputs["userManagedHttps"] = state?.userManagedHttps;
        }
        else {
            const args = argsOrState;
            if (args?.cdnEndpointId === undefined && !opts.urn) {
                throw new Error("Missing required property 'cdnEndpointId'");
            }
            if (args?.hostName === undefined && !opts.urn) {
                throw new Error("Missing required property 'hostName'");
            }
            resourceInputs["cdnEndpointId"] = args?.cdnEndpointId;
            resourceInputs["cdnManagedHttps"] = args?.cdnManagedHttps;
            resourceInputs["hostName"] = args?.hostName;
            resourceInputs["name"] = args?.name;
            resourceInputs["userManagedHttps"] = args?.userManagedHttps;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(EndpointCustomDomain.__pulumiType, name, resourceInputs, opts);
    }
}
exports.EndpointCustomDomain = EndpointCustomDomain;
//# sourceMappingURL=endpointCustomDomain.js.map