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

com.pulumi.gcp.cloudbuildv2.kotlin.Cloudbuildv2Functions.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.cloudbuildv2.kotlin

import com.pulumi.gcp.cloudbuildv2.Cloudbuildv2Functions.getConnectionIamPolicyPlain
import com.pulumi.gcp.cloudbuildv2.kotlin.inputs.GetConnectionIamPolicyPlainArgs
import com.pulumi.gcp.cloudbuildv2.kotlin.inputs.GetConnectionIamPolicyPlainArgsBuilder
import com.pulumi.gcp.cloudbuildv2.kotlin.outputs.GetConnectionIamPolicyResult
import com.pulumi.gcp.cloudbuildv2.kotlin.outputs.GetConnectionIamPolicyResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

public object Cloudbuildv2Functions {
    /**
     * Retrieves the current IAM policy data for connection
     * ## example
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const policy = gcp.cloudbuildv2.getConnectionIamPolicy({
     *     project: my_connection.project,
     *     location: my_connection.location,
     *     name: my_connection.name,
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * policy = gcp.cloudbuildv2.get_connection_iam_policy(project=my_connection["project"],
     *     location=my_connection["location"],
     *     name=my_connection["name"])
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var policy = Gcp.CloudBuildV2.GetConnectionIamPolicy.Invoke(new()
     *     {
     *         Project = my_connection.Project,
     *         Location = my_connection.Location,
     *         Name = my_connection.Name,
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudbuildv2"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := cloudbuildv2.GetConnectionIamPolicy(ctx, &cloudbuildv2.GetConnectionIamPolicyArgs{
     * 			Project:  pulumi.StringRef(my_connection.Project),
     * 			Location: pulumi.StringRef(my_connection.Location),
     * 			Name:     my_connection.Name,
     * 		}, 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.cloudbuildv2.Cloudbuildv2Functions;
     * import com.pulumi.gcp.cloudbuildv2.inputs.GetConnectionIamPolicyArgs;
     * 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 = Cloudbuildv2Functions.getConnectionIamPolicy(GetConnectionIamPolicyArgs.builder()
     *             .project(my_connection.project())
     *             .location(my_connection.location())
     *             .name(my_connection.name())
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   policy:
     *     fn::invoke:
     *       Function: gcp:cloudbuildv2:getConnectionIamPolicy
     *       Arguments:
     *         project: ${["my-connection"].project}
     *         location: ${["my-connection"].location}
     *         name: ${["my-connection"].name}
     * ```
     * 
     * @param argument A collection of arguments for invoking getConnectionIamPolicy.
     * @return A collection of values returned by getConnectionIamPolicy.
     */
    public suspend fun getConnectionIamPolicy(argument: GetConnectionIamPolicyPlainArgs): GetConnectionIamPolicyResult =
        toKotlin(getConnectionIamPolicyPlain(argument.toJava()).await())

    /**
     * @see [getConnectionIamPolicy].
     * @param location The location for the resource Used to find the parent resource to bind the IAM policy to. If not specified,
     * the value will be parsed from the identifier of the parent resource. If no location is provided in the parent identifier and no
     * location is specified, it is taken from the provider configuration.
     * @param name 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 getConnectionIamPolicy.
     */
    public suspend fun getConnectionIamPolicy(
        location: String? = null,
        name: String,
        project: String? = null,
    ): GetConnectionIamPolicyResult {
        val argument = GetConnectionIamPolicyPlainArgs(
            location = location,
            name = name,
            project = project,
        )
        return toKotlin(getConnectionIamPolicyPlain(argument.toJava()).await())
    }

    /**
     * @see [getConnectionIamPolicy].
     * @param argument Builder for [com.pulumi.gcp.cloudbuildv2.kotlin.inputs.GetConnectionIamPolicyPlainArgs].
     * @return A collection of values returned by getConnectionIamPolicy.
     */
    public suspend fun getConnectionIamPolicy(argument: suspend GetConnectionIamPolicyPlainArgsBuilder.() -> Unit): GetConnectionIamPolicyResult {
        val builder = GetConnectionIamPolicyPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return toKotlin(getConnectionIamPolicyPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy