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

com.pulumi.azure.maps.kotlin.MapsFunctions.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.maps.kotlin

import com.pulumi.azure.maps.MapsFunctions.getAccountPlain
import com.pulumi.azure.maps.kotlin.inputs.GetAccountPlainArgs
import com.pulumi.azure.maps.kotlin.inputs.GetAccountPlainArgsBuilder
import com.pulumi.azure.maps.kotlin.outputs.GetAccountResult
import com.pulumi.azure.maps.kotlin.outputs.GetAccountResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map

public object MapsFunctions {
    /**
     * Use this data source to access information about an existing Azure Maps Account.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as azure from "@pulumi/azure";
     * const example = azure.maps.getAccount({
     *     name: "production",
     *     resourceGroupName: "maps",
     * });
     * export const mapsAccountId = example.then(example => example.id);
     * ```
     * ```python
     * import pulumi
     * import pulumi_azure as azure
     * example = azure.maps.get_account(name="production",
     *     resource_group_name="maps")
     * pulumi.export("mapsAccountId", example.id)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Azure = Pulumi.Azure;
     * return await Deployment.RunAsync(() =>
     * {
     *     var example = Azure.Maps.GetAccount.Invoke(new()
     *     {
     *         Name = "production",
     *         ResourceGroupName = "maps",
     *     });
     *     return new Dictionary
     *     {
     *         ["mapsAccountId"] = example.Apply(getAccountResult => getAccountResult.Id),
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/maps"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		example, err := maps.LookupAccount(ctx, &maps.LookupAccountArgs{
     * 			Name:              "production",
     * 			ResourceGroupName: "maps",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("mapsAccountId", example.Id)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.azure.maps.MapsFunctions;
     * import com.pulumi.azure.maps.inputs.GetAccountArgs;
     * 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 = MapsFunctions.getAccount(GetAccountArgs.builder()
     *             .name("production")
     *             .resourceGroupName("maps")
     *             .build());
     *         ctx.export("mapsAccountId", example.applyValue(getAccountResult -> getAccountResult.id()));
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: azure:maps:getAccount
     *       Arguments:
     *         name: production
     *         resourceGroupName: maps
     * outputs:
     *   mapsAccountId: ${example.id}
     * ```
     * 
     * @param argument A collection of arguments for invoking getAccount.
     * @return A collection of values returned by getAccount.
     */
    public suspend fun getAccount(argument: GetAccountPlainArgs): GetAccountResult =
        toKotlin(getAccountPlain(argument.toJava()).await())

    /**
     * @see [getAccount].
     * @param name Specifies the name of the Maps Account.
     * @param resourceGroupName Specifies the name of the Resource Group in which the Maps Account is located.
     * @param tags
     * @return A collection of values returned by getAccount.
     */
    public suspend fun getAccount(
        name: String,
        resourceGroupName: String,
        tags: Map? = null,
    ): GetAccountResult {
        val argument = GetAccountPlainArgs(
            name = name,
            resourceGroupName = resourceGroupName,
            tags = tags,
        )
        return toKotlin(getAccountPlain(argument.toJava()).await())
    }

    /**
     * @see [getAccount].
     * @param argument Builder for [com.pulumi.azure.maps.kotlin.inputs.GetAccountPlainArgs].
     * @return A collection of values returned by getAccount.
     */
    public suspend fun getAccount(argument: suspend GetAccountPlainArgsBuilder.() -> Unit): GetAccountResult {
        val builder = GetAccountPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return toKotlin(getAccountPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy