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

com.pulumi.gcp.apigee.kotlin.ApigeeFunctions.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.apigee.kotlin

import com.pulumi.gcp.apigee.ApigeeFunctions.getEnvironmentIamPolicyPlain
import com.pulumi.gcp.apigee.kotlin.inputs.GetEnvironmentIamPolicyPlainArgs
import com.pulumi.gcp.apigee.kotlin.inputs.GetEnvironmentIamPolicyPlainArgsBuilder
import com.pulumi.gcp.apigee.kotlin.outputs.GetEnvironmentIamPolicyResult
import com.pulumi.gcp.apigee.kotlin.outputs.GetEnvironmentIamPolicyResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

public object ApigeeFunctions {
    /**
     * Retrieves the current IAM policy data for environment
     * ## example
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const policy = gcp.apigee.getEnvironmentIamPolicy({
     *     orgId: apigeeEnvironment.orgId,
     *     envId: apigeeEnvironment.name,
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * policy = gcp.apigee.get_environment_iam_policy(org_id=apigee_environment["orgId"],
     *     env_id=apigee_environment["name"])
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var policy = Gcp.Apigee.GetEnvironmentIamPolicy.Invoke(new()
     *     {
     *         OrgId = apigeeEnvironment.OrgId,
     *         EnvId = apigeeEnvironment.Name,
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/apigee"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := apigee.LookupEnvironmentIamPolicy(ctx, &apigee.LookupEnvironmentIamPolicyArgs{
     * 			OrgId: apigeeEnvironment.OrgId,
     * 			EnvId: apigeeEnvironment.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.apigee.ApigeeFunctions;
     * import com.pulumi.gcp.apigee.inputs.GetEnvironmentIamPolicyArgs;
     * 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 = ApigeeFunctions.getEnvironmentIamPolicy(GetEnvironmentIamPolicyArgs.builder()
     *             .orgId(apigeeEnvironment.orgId())
     *             .envId(apigeeEnvironment.name())
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   policy:
     *     fn::invoke:
     *       Function: gcp:apigee:getEnvironmentIamPolicy
     *       Arguments:
     *         orgId: ${apigeeEnvironment.orgId}
     *         envId: ${apigeeEnvironment.name}
     * ```
     * 
     * @param argument A collection of arguments for invoking getEnvironmentIamPolicy.
     * @return A collection of values returned by getEnvironmentIamPolicy.
     */
    public suspend fun getEnvironmentIamPolicy(argument: GetEnvironmentIamPolicyPlainArgs): GetEnvironmentIamPolicyResult =
        toKotlin(getEnvironmentIamPolicyPlain(argument.toJava()).await())

    /**
     * @see [getEnvironmentIamPolicy].
     * @param envId Used to find the parent resource to bind the IAM policy to
     * @param orgId
     * @return A collection of values returned by getEnvironmentIamPolicy.
     */
    public suspend fun getEnvironmentIamPolicy(envId: String, orgId: String): GetEnvironmentIamPolicyResult {
        val argument = GetEnvironmentIamPolicyPlainArgs(
            envId = envId,
            orgId = orgId,
        )
        return toKotlin(getEnvironmentIamPolicyPlain(argument.toJava()).await())
    }

    /**
     * @see [getEnvironmentIamPolicy].
     * @param argument Builder for [com.pulumi.gcp.apigee.kotlin.inputs.GetEnvironmentIamPolicyPlainArgs].
     * @return A collection of values returned by getEnvironmentIamPolicy.
     */
    public suspend fun getEnvironmentIamPolicy(argument: suspend GetEnvironmentIamPolicyPlainArgsBuilder.() -> Unit): GetEnvironmentIamPolicyResult {
        val builder = GetEnvironmentIamPolicyPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return toKotlin(getEnvironmentIamPolicyPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy