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

com.pulumi.gcp.billing.kotlin.BillingFunctions.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.billing.kotlin

import com.pulumi.gcp.billing.BillingFunctions.getAccountIamPolicyPlain
import com.pulumi.gcp.billing.kotlin.inputs.GetAccountIamPolicyPlainArgs
import com.pulumi.gcp.billing.kotlin.inputs.GetAccountIamPolicyPlainArgsBuilder
import com.pulumi.gcp.billing.kotlin.outputs.GetAccountIamPolicyResult
import com.pulumi.gcp.billing.kotlin.outputs.GetAccountIamPolicyResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

public object BillingFunctions {
    /**
     * Retrieves the current IAM policy data for a Billing Account.
     * ## example
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const policy = gcp.billing.getAccountIamPolicy({
     *     billingAccountId: "MEEP-MEEP-MEEP-MEEP-MEEP",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * policy = gcp.billing.get_account_iam_policy(billing_account_id="MEEP-MEEP-MEEP-MEEP-MEEP")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var policy = Gcp.Billing.GetAccountIamPolicy.Invoke(new()
     *     {
     *         BillingAccountId = "MEEP-MEEP-MEEP-MEEP-MEEP",
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/billing"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := billing.LookupAccountIamPolicy(ctx, &billing.LookupAccountIamPolicyArgs{
     * 			BillingAccountId: "MEEP-MEEP-MEEP-MEEP-MEEP",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.gcp.billing.BillingFunctions;
     * import com.pulumi.gcp.billing.inputs.GetAccountIamPolicyArgs;
     * 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 policy = BillingFunctions.getAccountIamPolicy(GetAccountIamPolicyArgs.builder()
     *             .billingAccountId("MEEP-MEEP-MEEP-MEEP-MEEP")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   policy:
     *     fn::invoke:
     *       Function: gcp:billing:getAccountIamPolicy
     *       Arguments:
     *         billingAccountId: MEEP-MEEP-MEEP-MEEP-MEEP
     * ```
     * 
     * @param argument A collection of arguments for invoking getAccountIamPolicy.
     * @return A collection of values returned by getAccountIamPolicy.
     */
    public suspend fun getAccountIamPolicy(argument: GetAccountIamPolicyPlainArgs): GetAccountIamPolicyResult = toKotlin(getAccountIamPolicyPlain(argument.toJava()).await())

    /**
     * @see [getAccountIamPolicy].
     * @param billingAccountId The billing account id.
     * @return A collection of values returned by getAccountIamPolicy.
     */
    public suspend fun getAccountIamPolicy(billingAccountId: String): GetAccountIamPolicyResult {
        val argument = GetAccountIamPolicyPlainArgs(
            billingAccountId = billingAccountId,
        )
        return toKotlin(getAccountIamPolicyPlain(argument.toJava()).await())
    }

    /**
     * @see [getAccountIamPolicy].
     * @param argument Builder for [com.pulumi.gcp.billing.kotlin.inputs.GetAccountIamPolicyPlainArgs].
     * @return A collection of values returned by getAccountIamPolicy.
     */
    public suspend fun getAccountIamPolicy(argument: suspend GetAccountIamPolicyPlainArgsBuilder.() -> Unit): GetAccountIamPolicyResult {
        val builder = GetAccountIamPolicyPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return toKotlin(getAccountIamPolicyPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy