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

com.pulumi.gcp.runtimeconfig.kotlin.RuntimeconfigFunctions.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.runtimeconfig.kotlin

import com.pulumi.gcp.runtimeconfig.RuntimeconfigFunctions.getConfigIamPolicyPlain
import com.pulumi.gcp.runtimeconfig.RuntimeconfigFunctions.getConfigPlain
import com.pulumi.gcp.runtimeconfig.RuntimeconfigFunctions.getVariablePlain
import com.pulumi.gcp.runtimeconfig.kotlin.inputs.GetConfigIamPolicyPlainArgs
import com.pulumi.gcp.runtimeconfig.kotlin.inputs.GetConfigIamPolicyPlainArgsBuilder
import com.pulumi.gcp.runtimeconfig.kotlin.inputs.GetConfigPlainArgs
import com.pulumi.gcp.runtimeconfig.kotlin.inputs.GetConfigPlainArgsBuilder
import com.pulumi.gcp.runtimeconfig.kotlin.inputs.GetVariablePlainArgs
import com.pulumi.gcp.runtimeconfig.kotlin.inputs.GetVariablePlainArgsBuilder
import com.pulumi.gcp.runtimeconfig.kotlin.outputs.GetConfigIamPolicyResult
import com.pulumi.gcp.runtimeconfig.kotlin.outputs.GetConfigResult
import com.pulumi.gcp.runtimeconfig.kotlin.outputs.GetVariableResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.runtimeconfig.kotlin.outputs.GetConfigIamPolicyResult.Companion.toKotlin as getConfigIamPolicyResultToKotlin
import com.pulumi.gcp.runtimeconfig.kotlin.outputs.GetConfigResult.Companion.toKotlin as getConfigResultToKotlin
import com.pulumi.gcp.runtimeconfig.kotlin.outputs.GetVariableResult.Companion.toKotlin as getVariableResultToKotlin

public object RuntimeconfigFunctions {
    /**
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const run-service = gcp.runtimeconfig.getConfig({
     *     name: "my-service",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * run_service = gcp.runtimeconfig.get_config(name="my-service")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var run_service = Gcp.RuntimeConfig.GetConfig.Invoke(new()
     *     {
     *         Name = "my-service",
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/runtimeconfig"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := runtimeconfig.LookupConfig(ctx, &runtimeconfig.LookupConfigArgs{
     * 			Name: "my-service",
     * 		}, 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.runtimeconfig.RuntimeconfigFunctions;
     * import com.pulumi.gcp.runtimeconfig.inputs.GetConfigArgs;
     * 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 run-service = RuntimeconfigFunctions.getConfig(GetConfigArgs.builder()
     *             .name("my-service")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   run-service:
     *     fn::invoke:
     *       Function: gcp:runtimeconfig:getConfig
     *       Arguments:
     *         name: my-service
     * ```
     * 
     * @param argument A collection of arguments for invoking getConfig.
     * @return A collection of values returned by getConfig.
     */
    public suspend fun getConfig(argument: GetConfigPlainArgs): GetConfigResult =
        getConfigResultToKotlin(getConfigPlain(argument.toJava()).await())

    /**
     * @see [getConfig].
     * @param name The name of the Runtime Configurator configuration.
     * - - -
     * @param project The project in which the resource belongs. If it
     * is not provided, the provider project is used.
     * @return A collection of values returned by getConfig.
     */
    public suspend fun getConfig(name: String, project: String? = null): GetConfigResult {
        val argument = GetConfigPlainArgs(
            name = name,
            project = project,
        )
        return getConfigResultToKotlin(getConfigPlain(argument.toJava()).await())
    }

    /**
     * @see [getConfig].
     * @param argument Builder for [com.pulumi.gcp.runtimeconfig.kotlin.inputs.GetConfigPlainArgs].
     * @return A collection of values returned by getConfig.
     */
    public suspend fun getConfig(argument: suspend GetConfigPlainArgsBuilder.() -> Unit): GetConfigResult {
        val builder = GetConfigPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getConfigResultToKotlin(getConfigPlain(builtArgument.toJava()).await())
    }

    /**
     *
     * @param argument A collection of arguments for invoking getConfigIamPolicy.
     * @return A collection of values returned by getConfigIamPolicy.
     */
    public suspend fun getConfigIamPolicy(argument: GetConfigIamPolicyPlainArgs): GetConfigIamPolicyResult =
        getConfigIamPolicyResultToKotlin(getConfigIamPolicyPlain(argument.toJava()).await())

    /**
     * @see [getConfigIamPolicy].
     * @param config 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 getConfigIamPolicy.
     */
    public suspend fun getConfigIamPolicy(config: String, project: String? = null): GetConfigIamPolicyResult {
        val argument = GetConfigIamPolicyPlainArgs(
            config = config,
            project = project,
        )
        return getConfigIamPolicyResultToKotlin(getConfigIamPolicyPlain(argument.toJava()).await())
    }

    /**
     * @see [getConfigIamPolicy].
     * @param argument Builder for [com.pulumi.gcp.runtimeconfig.kotlin.inputs.GetConfigIamPolicyPlainArgs].
     * @return A collection of values returned by getConfigIamPolicy.
     */
    public suspend fun getConfigIamPolicy(argument: suspend GetConfigIamPolicyPlainArgsBuilder.() -> Unit): GetConfigIamPolicyResult {
        val builder = GetConfigIamPolicyPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getConfigIamPolicyResultToKotlin(getConfigIamPolicyPlain(builtArgument.toJava()).await())
    }

    /**
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const run-service = gcp.runtimeconfig.getVariable({
     *     parent: "my-service",
     *     name: "prod-variables/hostname",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * run_service = gcp.runtimeconfig.get_variable(parent="my-service",
     *     name="prod-variables/hostname")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var run_service = Gcp.RuntimeConfig.GetVariable.Invoke(new()
     *     {
     *         Parent = "my-service",
     *         Name = "prod-variables/hostname",
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/runtimeconfig"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := runtimeconfig.LookupVariable(ctx, &runtimeconfig.LookupVariableArgs{
     * 			Parent: "my-service",
     * 			Name:   "prod-variables/hostname",
     * 		}, 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.runtimeconfig.RuntimeconfigFunctions;
     * import com.pulumi.gcp.runtimeconfig.inputs.GetVariableArgs;
     * 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 run-service = RuntimeconfigFunctions.getVariable(GetVariableArgs.builder()
     *             .parent("my-service")
     *             .name("prod-variables/hostname")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   run-service:
     *     fn::invoke:
     *       Function: gcp:runtimeconfig:getVariable
     *       Arguments:
     *         parent: my-service
     *         name: prod-variables/hostname
     * ```
     * 
     * @param argument A collection of arguments for invoking getVariable.
     * @return A collection of values returned by getVariable.
     */
    public suspend fun getVariable(argument: GetVariablePlainArgs): GetVariableResult =
        getVariableResultToKotlin(getVariablePlain(argument.toJava()).await())

    /**
     * @see [getVariable].
     * @param name The name of the Runtime Configurator configuration.
     * @param parent The name of the RuntimeConfig resource containing this variable.
     * - - -
     * @param project The project in which the resource belongs. If it
     * is not provided, the provider project is used.
     * @return A collection of values returned by getVariable.
     */
    public suspend fun getVariable(
        name: String,
        parent: String,
        project: String? = null,
    ): GetVariableResult {
        val argument = GetVariablePlainArgs(
            name = name,
            parent = parent,
            project = project,
        )
        return getVariableResultToKotlin(getVariablePlain(argument.toJava()).await())
    }

    /**
     * @see [getVariable].
     * @param argument Builder for [com.pulumi.gcp.runtimeconfig.kotlin.inputs.GetVariablePlainArgs].
     * @return A collection of values returned by getVariable.
     */
    public suspend fun getVariable(argument: suspend GetVariablePlainArgsBuilder.() -> Unit): GetVariableResult {
        val builder = GetVariablePlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getVariableResultToKotlin(getVariablePlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy