All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.aadb2c.kotlin.Aadb2cFunctions.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.aadb2c.kotlin

import com.pulumi.azure.aadb2c.Aadb2cFunctions.getDirectoryPlain
import com.pulumi.azure.aadb2c.kotlin.inputs.GetDirectoryPlainArgs
import com.pulumi.azure.aadb2c.kotlin.inputs.GetDirectoryPlainArgsBuilder
import com.pulumi.azure.aadb2c.kotlin.outputs.GetDirectoryResult
import com.pulumi.azure.aadb2c.kotlin.outputs.GetDirectoryResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

public object Aadb2cFunctions {
    /**
     * Use this data source to access information about an existing AAD B2C Directory.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as azure from "@pulumi/azure";
     * const example = azure.aadb2c.getDirectory({
     *     resourceGroupName: "example-rg",
     *     domainName: "exampleb2ctenant.onmicrosoft.com",
     * });
     * export const tenantId = example.then(example => example.tenantId);
     * ```
     * ```python
     * import pulumi
     * import pulumi_azure as azure
     * example = azure.aadb2c.get_directory(resource_group_name="example-rg",
     *     domain_name="exampleb2ctenant.onmicrosoft.com")
     * pulumi.export("tenantId", example.tenant_id)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Azure = Pulumi.Azure;
     * return await Deployment.RunAsync(() =>
     * {
     *     var example = Azure.AadB2C.GetDirectory.Invoke(new()
     *     {
     *         ResourceGroupName = "example-rg",
     *         DomainName = "exampleb2ctenant.onmicrosoft.com",
     *     });
     *     return new Dictionary
     *     {
     *         ["tenantId"] = example.Apply(getDirectoryResult => getDirectoryResult.TenantId),
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/aadb2c"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		example, err := aadb2c.LookupDirectory(ctx, &aadb2c.LookupDirectoryArgs{
     * 			ResourceGroupName: "example-rg",
     * 			DomainName:        "exampleb2ctenant.onmicrosoft.com",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("tenantId", example.TenantId)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.azure.aadb2c.Aadb2cFunctions;
     * import com.pulumi.azure.aadb2c.inputs.GetDirectoryArgs;
     * 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) {
     *         final var example = Aadb2cFunctions.getDirectory(GetDirectoryArgs.builder()
     *             .resourceGroupName("example-rg")
     *             .domainName("exampleb2ctenant.onmicrosoft.com")
     *             .build());
     *         ctx.export("tenantId", example.applyValue(getDirectoryResult -> getDirectoryResult.tenantId()));
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: azure:aadb2c:getDirectory
     *       Arguments:
     *         resourceGroupName: example-rg
     *         domainName: exampleb2ctenant.onmicrosoft.com
     * outputs:
     *   tenantId: ${example.tenantId}
     * ```
     * 
     * @param argument A collection of arguments for invoking getDirectory.
     * @return A collection of values returned by getDirectory.
     */
    public suspend fun getDirectory(argument: GetDirectoryPlainArgs): GetDirectoryResult =
        toKotlin(getDirectoryPlain(argument.toJava()).await())

    /**
     * @see [getDirectory].
     * @param domainName Domain name of the B2C tenant, including the `.onmicrosoft.com` suffix.
     * @param resourceGroupName The name of the Resource Group where the AAD B2C Directory exists.
     * @return A collection of values returned by getDirectory.
     */
    public suspend fun getDirectory(domainName: String, resourceGroupName: String): GetDirectoryResult {
        val argument = GetDirectoryPlainArgs(
            domainName = domainName,
            resourceGroupName = resourceGroupName,
        )
        return toKotlin(getDirectoryPlain(argument.toJava()).await())
    }

    /**
     * @see [getDirectory].
     * @param argument Builder for [com.pulumi.azure.aadb2c.kotlin.inputs.GetDirectoryPlainArgs].
     * @return A collection of values returned by getDirectory.
     */
    public suspend fun getDirectory(argument: suspend GetDirectoryPlainArgsBuilder.() -> Unit): GetDirectoryResult {
        val builder = GetDirectoryPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return toKotlin(getDirectoryPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy