"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.IdentityProviderAadb2c = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an API Management Azure AD B2C Identity Provider.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as azuread from "@pulumi/azuread";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleService = new azure.apimanagement.Service("example", {
 *     name: "example-apim",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     publisherName: "My Company",
 *     publisherEmail: "company@terraform.io",
 *     skuName: "Developer_1",
 * });
 * const exampleApplication = new azuread.Application("example", {displayName: "acctestam-example"});
 * const exampleApplicationPassword = new azuread.ApplicationPassword("example", {
 *     applicationObjectId: exampleApplication.objectId,
 *     endDateRelative: "36h",
 * });
 * const exampleIdentityProviderAadb2c = new azure.apimanagement.IdentityProviderAadb2c("example", {
 *     resourceGroupName: example.name,
 *     apiManagementName: exampleService.name,
 *     clientId: exampleApplication.applicationId,
 *     clientSecret: "P@55w0rD!",
 *     allowedTenant: "myb2ctenant.onmicrosoft.com",
 *     signinTenant: "myb2ctenant.onmicrosoft.com",
 *     authority: "myb2ctenant.b2clogin.com",
 *     signinPolicy: "B2C_1_Login",
 *     signupPolicy: "B2C_1_Signup",
 * }, {
 *     dependsOn: [exampleApplicationPassword],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.ApiManagement` - 2022-08-01
 *
 * ## Import
 *
 * API Management Azure AD B2C Identity Providers can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:apimanagement/identityProviderAadb2c:IdentityProviderAadb2c example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/service1/identityProviders/aadB2C
 * ```
 */
class IdentityProviderAadb2c extends pulumi.CustomResource {
    /**
     * Get an existing IdentityProviderAadb2c 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 IdentityProviderAadb2c(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:apimanagement/identityProviderAadb2c:IdentityProviderAadb2c';
    /**
     * Returns true if the given object is an instance of IdentityProviderAadb2c.  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'] === IdentityProviderAadb2c.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["allowedTenant"] = state?.allowedTenant;
            resourceInputs["apiManagementName"] = state?.apiManagementName;
            resourceInputs["authority"] = state?.authority;
            resourceInputs["clientId"] = state?.clientId;
            resourceInputs["clientLibrary"] = state?.clientLibrary;
            resourceInputs["clientSecret"] = state?.clientSecret;
            resourceInputs["passwordResetPolicy"] = state?.passwordResetPolicy;
            resourceInputs["profileEditingPolicy"] = state?.profileEditingPolicy;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["signinPolicy"] = state?.signinPolicy;
            resourceInputs["signinTenant"] = state?.signinTenant;
            resourceInputs["signupPolicy"] = state?.signupPolicy;
        }
        else {
            const args = argsOrState;
            if (args?.allowedTenant === undefined && !opts.urn) {
                throw new Error("Missing required property 'allowedTenant'");
            }
            if (args?.apiManagementName === undefined && !opts.urn) {
                throw new Error("Missing required property 'apiManagementName'");
            }
            if (args?.authority === undefined && !opts.urn) {
                throw new Error("Missing required property 'authority'");
            }
            if (args?.clientId === undefined && !opts.urn) {
                throw new Error("Missing required property 'clientId'");
            }
            if (args?.clientSecret === undefined && !opts.urn) {
                throw new Error("Missing required property 'clientSecret'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.signinPolicy === undefined && !opts.urn) {
                throw new Error("Missing required property 'signinPolicy'");
            }
            if (args?.signinTenant === undefined && !opts.urn) {
                throw new Error("Missing required property 'signinTenant'");
            }
            if (args?.signupPolicy === undefined && !opts.urn) {
                throw new Error("Missing required property 'signupPolicy'");
            }
            resourceInputs["allowedTenant"] = args?.allowedTenant;
            resourceInputs["apiManagementName"] = args?.apiManagementName;
            resourceInputs["authority"] = args?.authority;
            resourceInputs["clientId"] = args?.clientId;
            resourceInputs["clientLibrary"] = args?.clientLibrary;
            resourceInputs["clientSecret"] = args?.clientSecret ? pulumi.secret(args.clientSecret) : undefined;
            resourceInputs["passwordResetPolicy"] = args?.passwordResetPolicy;
            resourceInputs["profileEditingPolicy"] = args?.profileEditingPolicy;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["signinPolicy"] = args?.signinPolicy;
            resourceInputs["signinTenant"] = args?.signinTenant;
            resourceInputs["signupPolicy"] = args?.signupPolicy;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["clientSecret"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(IdentityProviderAadb2c.__pulumiType, name, resourceInputs, opts);
    }
}
exports.IdentityProviderAadb2c = IdentityProviderAadb2c;
//# sourceMappingURL=identityProviderAadb2c.js.map