com.pulumi.gcp.bigquerydatapolicy.kotlin.BigquerydatapolicyFunctions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.bigquerydatapolicy.kotlin
import com.pulumi.gcp.bigquerydatapolicy.BigquerydatapolicyFunctions.getIamPolicyPlain
import com.pulumi.gcp.bigquerydatapolicy.kotlin.inputs.GetIamPolicyPlainArgs
import com.pulumi.gcp.bigquerydatapolicy.kotlin.inputs.GetIamPolicyPlainArgsBuilder
import com.pulumi.gcp.bigquerydatapolicy.kotlin.outputs.GetIamPolicyResult
import com.pulumi.gcp.bigquerydatapolicy.kotlin.outputs.GetIamPolicyResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object BigquerydatapolicyFunctions {
/**
* Retrieves the current IAM policy data for datapolicy
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.bigquerydatapolicy.getIamPolicy({
* project: dataPolicy.project,
* location: dataPolicy.location,
* dataPolicyId: dataPolicy.dataPolicyId,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.bigquerydatapolicy.get_iam_policy(project=data_policy["project"],
* location=data_policy["location"],
* data_policy_id=data_policy["dataPolicyId"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.BigQueryDataPolicy.GetIamPolicy.Invoke(new()
* {
* Project = dataPolicy.Project,
* Location = dataPolicy.Location,
* DataPolicyId = dataPolicy.DataPolicyId,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/bigquerydatapolicy"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := bigquerydatapolicy.GetIamPolicy(ctx, &bigquerydatapolicy.GetIamPolicyArgs{
* Project: pulumi.StringRef(dataPolicy.Project),
* Location: pulumi.StringRef(dataPolicy.Location),
* DataPolicyId: dataPolicy.DataPolicyId,
* }, 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.bigquerydatapolicy.BigquerydatapolicyFunctions;
* import com.pulumi.gcp.bigquerydatapolicy.inputs.GetIamPolicyArgs;
* 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 = BigquerydatapolicyFunctions.getIamPolicy(GetIamPolicyArgs.builder()
* .project(dataPolicy.project())
* .location(dataPolicy.location())
* .dataPolicyId(dataPolicy.dataPolicyId())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:bigquerydatapolicy:getIamPolicy
* Arguments:
* project: ${dataPolicy.project}
* location: ${dataPolicy.location}
* dataPolicyId: ${dataPolicy.dataPolicyId}
* ```
*
* @param argument A collection of arguments for invoking getIamPolicy.
* @return A collection of values returned by getIamPolicy.
*/
public suspend fun getIamPolicy(argument: GetIamPolicyPlainArgs): GetIamPolicyResult =
toKotlin(getIamPolicyPlain(argument.toJava()).await())
/**
* @see [getIamPolicy].
* @param dataPolicyId
* @param location The name of the location of the data policy.
* Used to find the parent resource to bind the IAM policy to
* @param project The ID of the project in which the resource belongs.
* If it is not provided, the project will be parsed from the identifier of the parent resource. If no project is provided in the parent identifier and no project is specified, the provider project is used.
* @return A collection of values returned by getIamPolicy.
*/
public suspend fun getIamPolicy(
dataPolicyId: String,
location: String? = null,
project: String? = null,
): GetIamPolicyResult {
val argument = GetIamPolicyPlainArgs(
dataPolicyId = dataPolicyId,
location = location,
project = project,
)
return toKotlin(getIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getIamPolicy].
* @param argument Builder for [com.pulumi.gcp.bigquerydatapolicy.kotlin.inputs.GetIamPolicyPlainArgs].
* @return A collection of values returned by getIamPolicy.
*/
public suspend fun getIamPolicy(argument: suspend GetIamPolicyPlainArgsBuilder.() -> Unit): GetIamPolicyResult {
val builder = GetIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getIamPolicyPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy