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

com.pulumi.gcp.endpoints.kotlin.EndpointsFunctions.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.endpoints.kotlin

import com.pulumi.gcp.endpoints.EndpointsFunctions.getServiceConsumersIamPolicyPlain
import com.pulumi.gcp.endpoints.EndpointsFunctions.getServiceIamPolicyPlain
import com.pulumi.gcp.endpoints.kotlin.inputs.GetServiceConsumersIamPolicyPlainArgs
import com.pulumi.gcp.endpoints.kotlin.inputs.GetServiceConsumersIamPolicyPlainArgsBuilder
import com.pulumi.gcp.endpoints.kotlin.inputs.GetServiceIamPolicyPlainArgs
import com.pulumi.gcp.endpoints.kotlin.inputs.GetServiceIamPolicyPlainArgsBuilder
import com.pulumi.gcp.endpoints.kotlin.outputs.GetServiceConsumersIamPolicyResult
import com.pulumi.gcp.endpoints.kotlin.outputs.GetServiceIamPolicyResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.endpoints.kotlin.outputs.GetServiceConsumersIamPolicyResult.Companion.toKotlin as getServiceConsumersIamPolicyResultToKotlin
import com.pulumi.gcp.endpoints.kotlin.outputs.GetServiceIamPolicyResult.Companion.toKotlin as getServiceIamPolicyResultToKotlin

public object EndpointsFunctions {
    /**
     * Retrieves the current IAM policy data for serviceconsumers
     * @param argument A collection of arguments for invoking getServiceConsumersIamPolicy.
     * @return A collection of values returned by getServiceConsumersIamPolicy.
     */
    public suspend fun getServiceConsumersIamPolicy(argument: GetServiceConsumersIamPolicyPlainArgs): GetServiceConsumersIamPolicyResult =
        getServiceConsumersIamPolicyResultToKotlin(getServiceConsumersIamPolicyPlain(argument.toJava()).await())

    /**
     * @see [getServiceConsumersIamPolicy].
     * @param consumerProject
     * @param serviceName
     * @return A collection of values returned by getServiceConsumersIamPolicy.
     */
    public suspend fun getServiceConsumersIamPolicy(consumerProject: String, serviceName: String): GetServiceConsumersIamPolicyResult {
        val argument = GetServiceConsumersIamPolicyPlainArgs(
            consumerProject = consumerProject,
            serviceName = serviceName,
        )
        return getServiceConsumersIamPolicyResultToKotlin(getServiceConsumersIamPolicyPlain(argument.toJava()).await())
    }

    /**
     * @see [getServiceConsumersIamPolicy].
     * @param argument Builder for [com.pulumi.gcp.endpoints.kotlin.inputs.GetServiceConsumersIamPolicyPlainArgs].
     * @return A collection of values returned by getServiceConsumersIamPolicy.
     */
    public suspend fun getServiceConsumersIamPolicy(argument: suspend GetServiceConsumersIamPolicyPlainArgsBuilder.() -> Unit): GetServiceConsumersIamPolicyResult {
        val builder = GetServiceConsumersIamPolicyPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getServiceConsumersIamPolicyResultToKotlin(getServiceConsumersIamPolicyPlain(builtArgument.toJava()).await())
    }

    /**
     * Retrieves the current IAM policy data for service
     * ## example
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const policy = gcp.endpoints.getServiceIamPolicy({
     *     serviceName: endpointsService.serviceName,
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * policy = gcp.endpoints.get_service_iam_policy(service_name=endpoints_service["serviceName"])
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var policy = Gcp.Endpoints.GetServiceIamPolicy.Invoke(new()
     *     {
     *         ServiceName = endpointsService.ServiceName,
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/endpoints"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := endpoints.LookupServiceIamPolicy(ctx, &endpoints.LookupServiceIamPolicyArgs{
     * 			ServiceName: endpointsService.ServiceName,
     * 		}, 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.endpoints.EndpointsFunctions;
     * import com.pulumi.gcp.endpoints.inputs.GetServiceIamPolicyArgs;
     * 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 = EndpointsFunctions.getServiceIamPolicy(GetServiceIamPolicyArgs.builder()
     *             .serviceName(endpointsService.serviceName())
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   policy:
     *     fn::invoke:
     *       Function: gcp:endpoints:getServiceIamPolicy
     *       Arguments:
     *         serviceName: ${endpointsService.serviceName}
     * ```
     * 
     * @param argument A collection of arguments for invoking getServiceIamPolicy.
     * @return A collection of values returned by getServiceIamPolicy.
     */
    public suspend fun getServiceIamPolicy(argument: GetServiceIamPolicyPlainArgs): GetServiceIamPolicyResult =
        getServiceIamPolicyResultToKotlin(getServiceIamPolicyPlain(argument.toJava()).await())

    /**
     * @see [getServiceIamPolicy].
     * @param serviceName
     * @return A collection of values returned by getServiceIamPolicy.
     */
    public suspend fun getServiceIamPolicy(serviceName: String): GetServiceIamPolicyResult {
        val argument = GetServiceIamPolicyPlainArgs(
            serviceName = serviceName,
        )
        return getServiceIamPolicyResultToKotlin(getServiceIamPolicyPlain(argument.toJava()).await())
    }

    /**
     * @see [getServiceIamPolicy].
     * @param argument Builder for [com.pulumi.gcp.endpoints.kotlin.inputs.GetServiceIamPolicyPlainArgs].
     * @return A collection of values returned by getServiceIamPolicy.
     */
    public suspend fun getServiceIamPolicy(argument: suspend GetServiceIamPolicyPlainArgsBuilder.() -> Unit): GetServiceIamPolicyResult {
        val builder = GetServiceIamPolicyPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getServiceIamPolicyResultToKotlin(getServiceIamPolicyPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy