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

com.pulumi.gcp.notebooks.kotlin.NotebooksFunctions.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.notebooks.kotlin

import com.pulumi.gcp.notebooks.NotebooksFunctions.getInstanceIamPolicyPlain
import com.pulumi.gcp.notebooks.NotebooksFunctions.getRuntimeIamPolicyPlain
import com.pulumi.gcp.notebooks.kotlin.inputs.GetInstanceIamPolicyPlainArgs
import com.pulumi.gcp.notebooks.kotlin.inputs.GetInstanceIamPolicyPlainArgsBuilder
import com.pulumi.gcp.notebooks.kotlin.inputs.GetRuntimeIamPolicyPlainArgs
import com.pulumi.gcp.notebooks.kotlin.inputs.GetRuntimeIamPolicyPlainArgsBuilder
import com.pulumi.gcp.notebooks.kotlin.outputs.GetInstanceIamPolicyResult
import com.pulumi.gcp.notebooks.kotlin.outputs.GetRuntimeIamPolicyResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.notebooks.kotlin.outputs.GetInstanceIamPolicyResult.Companion.toKotlin as getInstanceIamPolicyResultToKotlin
import com.pulumi.gcp.notebooks.kotlin.outputs.GetRuntimeIamPolicyResult.Companion.toKotlin as getRuntimeIamPolicyResultToKotlin

public object NotebooksFunctions {
    /**
     * Retrieves the current IAM policy data for instance
     * ## example
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const policy = gcp.notebooks.getInstanceIamPolicy({
     *     project: instance.project,
     *     location: instance.location,
     *     instanceName: instance.name,
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * policy = gcp.notebooks.get_instance_iam_policy(project=instance["project"],
     *     location=instance["location"],
     *     instance_name=instance["name"])
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var policy = Gcp.Notebooks.GetInstanceIamPolicy.Invoke(new()
     *     {
     *         Project = instance.Project,
     *         Location = instance.Location,
     *         InstanceName = instance.Name,
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/notebooks"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := notebooks.LookupInstanceIamPolicy(ctx, ¬ebooks.LookupInstanceIamPolicyArgs{
     * 			Project:      pulumi.StringRef(instance.Project),
     * 			Location:     pulumi.StringRef(instance.Location),
     * 			InstanceName: instance.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.notebooks.NotebooksFunctions;
     * import com.pulumi.gcp.notebooks.inputs.GetInstanceIamPolicyArgs;
     * 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 = NotebooksFunctions.getInstanceIamPolicy(GetInstanceIamPolicyArgs.builder()
     *             .project(instance.project())
     *             .location(instance.location())
     *             .instanceName(instance.name())
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   policy:
     *     fn::invoke:
     *       Function: gcp:notebooks:getInstanceIamPolicy
     *       Arguments:
     *         project: ${instance.project}
     *         location: ${instance.location}
     *         instanceName: ${instance.name}
     * ```
     * 
     * @param argument A collection of arguments for invoking getInstanceIamPolicy.
     * @return A collection of values returned by getInstanceIamPolicy.
     */
    public suspend fun getInstanceIamPolicy(argument: GetInstanceIamPolicyPlainArgs): GetInstanceIamPolicyResult =
        getInstanceIamPolicyResultToKotlin(getInstanceIamPolicyPlain(argument.toJava()).await())

    /**
     * @see [getInstanceIamPolicy].
     * @param instanceName Used to find the parent resource to bind the IAM policy to
     * @param location A reference to the zone where the machine resides. 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 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 getInstanceIamPolicy.
     */
    public suspend fun getInstanceIamPolicy(
        instanceName: String,
        location: String? = null,
        project: String? = null,
    ): GetInstanceIamPolicyResult {
        val argument = GetInstanceIamPolicyPlainArgs(
            instanceName = instanceName,
            location = location,
            project = project,
        )
        return getInstanceIamPolicyResultToKotlin(getInstanceIamPolicyPlain(argument.toJava()).await())
    }

    /**
     * @see [getInstanceIamPolicy].
     * @param argument Builder for [com.pulumi.gcp.notebooks.kotlin.inputs.GetInstanceIamPolicyPlainArgs].
     * @return A collection of values returned by getInstanceIamPolicy.
     */
    public suspend fun getInstanceIamPolicy(argument: suspend GetInstanceIamPolicyPlainArgsBuilder.() -> Unit): GetInstanceIamPolicyResult {
        val builder = GetInstanceIamPolicyPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getInstanceIamPolicyResultToKotlin(getInstanceIamPolicyPlain(builtArgument.toJava()).await())
    }

    /**
     * Retrieves the current IAM policy data for runtime
     * ## example
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const policy = gcp.notebooks.getRuntimeIamPolicy({
     *     project: runtime.project,
     *     location: runtime.location,
     *     runtimeName: runtime.name,
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * policy = gcp.notebooks.get_runtime_iam_policy(project=runtime["project"],
     *     location=runtime["location"],
     *     runtime_name=runtime["name"])
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var policy = Gcp.Notebooks.GetRuntimeIamPolicy.Invoke(new()
     *     {
     *         Project = runtime.Project,
     *         Location = runtime.Location,
     *         RuntimeName = runtime.Name,
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/notebooks"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := notebooks.LookupRuntimeIamPolicy(ctx, ¬ebooks.LookupRuntimeIamPolicyArgs{
     * 			Project:     pulumi.StringRef(runtime.Project),
     * 			Location:    pulumi.StringRef(runtime.Location),
     * 			RuntimeName: runtime.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.notebooks.NotebooksFunctions;
     * import com.pulumi.gcp.notebooks.inputs.GetRuntimeIamPolicyArgs;
     * 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 = NotebooksFunctions.getRuntimeIamPolicy(GetRuntimeIamPolicyArgs.builder()
     *             .project(runtime.project())
     *             .location(runtime.location())
     *             .runtimeName(runtime.name())
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   policy:
     *     fn::invoke:
     *       Function: gcp:notebooks:getRuntimeIamPolicy
     *       Arguments:
     *         project: ${runtime.project}
     *         location: ${runtime.location}
     *         runtimeName: ${runtime.name}
     * ```
     * 
     * @param argument A collection of arguments for invoking getRuntimeIamPolicy.
     * @return A collection of values returned by getRuntimeIamPolicy.
     */
    public suspend fun getRuntimeIamPolicy(argument: GetRuntimeIamPolicyPlainArgs): GetRuntimeIamPolicyResult =
        getRuntimeIamPolicyResultToKotlin(getRuntimeIamPolicyPlain(argument.toJava()).await())

    /**
     * @see [getRuntimeIamPolicy].
     * @param location A reference to the zone where the machine resides. 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 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.
     * @param runtimeName Used to find the parent resource to bind the IAM policy to
     * @return A collection of values returned by getRuntimeIamPolicy.
     */
    public suspend fun getRuntimeIamPolicy(
        location: String? = null,
        project: String? = null,
        runtimeName: String,
    ): GetRuntimeIamPolicyResult {
        val argument = GetRuntimeIamPolicyPlainArgs(
            location = location,
            project = project,
            runtimeName = runtimeName,
        )
        return getRuntimeIamPolicyResultToKotlin(getRuntimeIamPolicyPlain(argument.toJava()).await())
    }

    /**
     * @see [getRuntimeIamPolicy].
     * @param argument Builder for [com.pulumi.gcp.notebooks.kotlin.inputs.GetRuntimeIamPolicyPlainArgs].
     * @return A collection of values returned by getRuntimeIamPolicy.
     */
    public suspend fun getRuntimeIamPolicy(argument: suspend GetRuntimeIamPolicyPlainArgsBuilder.() -> Unit): GetRuntimeIamPolicyResult {
        val builder = GetRuntimeIamPolicyPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getRuntimeIamPolicyResultToKotlin(getRuntimeIamPolicyPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy