Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.gcp.pubsub.kotlin.PubsubFunctions.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.pubsub.kotlin
import com.pulumi.gcp.pubsub.PubsubFunctions.getSchemaIamPolicyPlain
import com.pulumi.gcp.pubsub.PubsubFunctions.getSubscriptionIamPolicyPlain
import com.pulumi.gcp.pubsub.PubsubFunctions.getSubscriptionPlain
import com.pulumi.gcp.pubsub.PubsubFunctions.getTopicIamPolicyPlain
import com.pulumi.gcp.pubsub.PubsubFunctions.getTopicPlain
import com.pulumi.gcp.pubsub.kotlin.inputs.GetSchemaIamPolicyPlainArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.GetSchemaIamPolicyPlainArgsBuilder
import com.pulumi.gcp.pubsub.kotlin.inputs.GetSubscriptionIamPolicyPlainArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.GetSubscriptionIamPolicyPlainArgsBuilder
import com.pulumi.gcp.pubsub.kotlin.inputs.GetSubscriptionPlainArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.GetSubscriptionPlainArgsBuilder
import com.pulumi.gcp.pubsub.kotlin.inputs.GetTopicIamPolicyPlainArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.GetTopicIamPolicyPlainArgsBuilder
import com.pulumi.gcp.pubsub.kotlin.inputs.GetTopicPlainArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.GetTopicPlainArgsBuilder
import com.pulumi.gcp.pubsub.kotlin.outputs.GetSchemaIamPolicyResult
import com.pulumi.gcp.pubsub.kotlin.outputs.GetSubscriptionIamPolicyResult
import com.pulumi.gcp.pubsub.kotlin.outputs.GetSubscriptionResult
import com.pulumi.gcp.pubsub.kotlin.outputs.GetTopicIamPolicyResult
import com.pulumi.gcp.pubsub.kotlin.outputs.GetTopicResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.pubsub.kotlin.outputs.GetSchemaIamPolicyResult.Companion.toKotlin as getSchemaIamPolicyResultToKotlin
import com.pulumi.gcp.pubsub.kotlin.outputs.GetSubscriptionIamPolicyResult.Companion.toKotlin as getSubscriptionIamPolicyResultToKotlin
import com.pulumi.gcp.pubsub.kotlin.outputs.GetSubscriptionResult.Companion.toKotlin as getSubscriptionResultToKotlin
import com.pulumi.gcp.pubsub.kotlin.outputs.GetTopicIamPolicyResult.Companion.toKotlin as getTopicIamPolicyResultToKotlin
import com.pulumi.gcp.pubsub.kotlin.outputs.GetTopicResult.Companion.toKotlin as getTopicResultToKotlin
public object PubsubFunctions {
/**
* Retrieves the current IAM policy data for schema
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.pubsub.getSchemaIamPolicy({
* project: example.project,
* schema: example.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.pubsub.get_schema_iam_policy(project=example["project"],
* schema=example["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.PubSub.GetSchemaIamPolicy.Invoke(new()
* {
* Project = example.Project,
* Schema = example.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := pubsub.LookupSchemaIamPolicy(ctx, &pubsub.LookupSchemaIamPolicyArgs{
* Project: pulumi.StringRef(example.Project),
* Schema: example.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.pubsub.PubsubFunctions;
* import com.pulumi.gcp.pubsub.inputs.GetSchemaIamPolicyArgs;
* 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 = PubsubFunctions.getSchemaIamPolicy(GetSchemaIamPolicyArgs.builder()
* .project(example.project())
* .schema(example.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:pubsub:getSchemaIamPolicy
* Arguments:
* project: ${example.project}
* schema: ${example.name}
* ```
*
* @param argument A collection of arguments for invoking getSchemaIamPolicy.
* @return A collection of values returned by getSchemaIamPolicy.
*/
public suspend fun getSchemaIamPolicy(argument: GetSchemaIamPolicyPlainArgs): GetSchemaIamPolicyResult =
getSchemaIamPolicyResultToKotlin(getSchemaIamPolicyPlain(argument.toJava()).await())
/**
* @see [getSchemaIamPolicy].
* @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 schema Used to find the parent resource to bind the IAM policy to
* @return A collection of values returned by getSchemaIamPolicy.
*/
public suspend fun getSchemaIamPolicy(project: String? = null, schema: String): GetSchemaIamPolicyResult {
val argument = GetSchemaIamPolicyPlainArgs(
project = project,
schema = schema,
)
return getSchemaIamPolicyResultToKotlin(getSchemaIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getSchemaIamPolicy].
* @param argument Builder for [com.pulumi.gcp.pubsub.kotlin.inputs.GetSchemaIamPolicyPlainArgs].
* @return A collection of values returned by getSchemaIamPolicy.
*/
public suspend fun getSchemaIamPolicy(argument: suspend GetSchemaIamPolicyPlainArgsBuilder.() -> Unit): GetSchemaIamPolicyResult {
val builder = GetSchemaIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getSchemaIamPolicyResultToKotlin(getSchemaIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Get information about a Google Cloud Pub/Sub Subscription. For more information see
* the [official documentation](https://cloud.google.com/pubsub/docs/)
* and [API](https://cloud.google.com/pubsub/docs/apis).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const my-pubsub-subscription = gcp.pubsub.getSubscription({
* name: "my-pubsub-subscription",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* my_pubsub_subscription = gcp.pubsub.get_subscription(name="my-pubsub-subscription")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var my_pubsub_subscription = Gcp.PubSub.GetSubscription.Invoke(new()
* {
* Name = "my-pubsub-subscription",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := pubsub.LookupSubscription(ctx, &pubsub.LookupSubscriptionArgs{
* Name: "my-pubsub-subscription",
* }, 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.pubsub.PubsubFunctions;
* import com.pulumi.gcp.pubsub.inputs.GetSubscriptionArgs;
* 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 my-pubsub-subscription = PubsubFunctions.getSubscription(GetSubscriptionArgs.builder()
* .name("my-pubsub-subscription")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* my-pubsub-subscription:
* fn::invoke:
* Function: gcp:pubsub:getSubscription
* Arguments:
* name: my-pubsub-subscription
* ```
*
* @param argument A collection of arguments for invoking getSubscription.
* @return A collection of values returned by getSubscription.
*/
public suspend fun getSubscription(argument: GetSubscriptionPlainArgs): GetSubscriptionResult =
getSubscriptionResultToKotlin(getSubscriptionPlain(argument.toJava()).await())
/**
* @see [getSubscription].
* @param name The name of the Cloud Pub/Sub Subscription.
* - - -
* @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 getSubscription.
*/
public suspend fun getSubscription(name: String, project: String? = null): GetSubscriptionResult {
val argument = GetSubscriptionPlainArgs(
name = name,
project = project,
)
return getSubscriptionResultToKotlin(getSubscriptionPlain(argument.toJava()).await())
}
/**
* @see [getSubscription].
* @param argument Builder for [com.pulumi.gcp.pubsub.kotlin.inputs.GetSubscriptionPlainArgs].
* @return A collection of values returned by getSubscription.
*/
public suspend fun getSubscription(argument: suspend GetSubscriptionPlainArgsBuilder.() -> Unit): GetSubscriptionResult {
val builder = GetSubscriptionPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getSubscriptionResultToKotlin(getSubscriptionPlain(builtArgument.toJava()).await())
}
/**
* Retrieves the current IAM policy data for a Pubsub subscription.
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.pubsub.getSubscriptionIamPolicy({
* subscription: subscription.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.pubsub.get_subscription_iam_policy(subscription=subscription["id"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.PubSub.GetSubscriptionIamPolicy.Invoke(new()
* {
* Subscription = subscription.Id,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := pubsub.GetSubscriptionIamPolicy(ctx, &pubsub.GetSubscriptionIamPolicyArgs{
* Subscription: subscription.Id,
* }, 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.pubsub.PubsubFunctions;
* import com.pulumi.gcp.pubsub.inputs.GetSubscriptionIamPolicyArgs;
* 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 = PubsubFunctions.getSubscriptionIamPolicy(GetSubscriptionIamPolicyArgs.builder()
* .subscription(subscription.id())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:pubsub:getSubscriptionIamPolicy
* Arguments:
* subscription: ${subscription.id}
* ```
*
* @param argument A collection of arguments for invoking getSubscriptionIamPolicy.
* @return A collection of values returned by getSubscriptionIamPolicy.
*/
public suspend fun getSubscriptionIamPolicy(argument: GetSubscriptionIamPolicyPlainArgs): GetSubscriptionIamPolicyResult =
getSubscriptionIamPolicyResultToKotlin(getSubscriptionIamPolicyPlain(argument.toJava()).await())
/**
* @see [getSubscriptionIamPolicy].
* @param project The project in which the resource belongs. If it
* is not provided, the provider project is used.
* @param subscription The subscription name or id to bind to attach IAM policy to.
* @return A collection of values returned by getSubscriptionIamPolicy.
*/
public suspend fun getSubscriptionIamPolicy(project: String? = null, subscription: String): GetSubscriptionIamPolicyResult {
val argument = GetSubscriptionIamPolicyPlainArgs(
project = project,
subscription = subscription,
)
return getSubscriptionIamPolicyResultToKotlin(getSubscriptionIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getSubscriptionIamPolicy].
* @param argument Builder for [com.pulumi.gcp.pubsub.kotlin.inputs.GetSubscriptionIamPolicyPlainArgs].
* @return A collection of values returned by getSubscriptionIamPolicy.
*/
public suspend fun getSubscriptionIamPolicy(argument: suspend GetSubscriptionIamPolicyPlainArgsBuilder.() -> Unit): GetSubscriptionIamPolicyResult {
val builder = GetSubscriptionIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getSubscriptionIamPolicyResultToKotlin(getSubscriptionIamPolicyPlain(builtArgument.toJava()).await())
}
/**
* Get information about a Google Cloud Pub/Sub Topic. For more information see
* the [official documentation](https://cloud.google.com/pubsub/docs/)
* and [API](https://cloud.google.com/pubsub/docs/apis).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const my-pubsub-topic = gcp.pubsub.getTopic({
* name: "my-pubsub-topic",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* my_pubsub_topic = gcp.pubsub.get_topic(name="my-pubsub-topic")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var my_pubsub_topic = Gcp.PubSub.GetTopic.Invoke(new()
* {
* Name = "my-pubsub-topic",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := pubsub.LookupTopic(ctx, &pubsub.LookupTopicArgs{
* Name: "my-pubsub-topic",
* }, 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.pubsub.PubsubFunctions;
* import com.pulumi.gcp.pubsub.inputs.GetTopicArgs;
* 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 my-pubsub-topic = PubsubFunctions.getTopic(GetTopicArgs.builder()
* .name("my-pubsub-topic")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* my-pubsub-topic:
* fn::invoke:
* Function: gcp:pubsub:getTopic
* Arguments:
* name: my-pubsub-topic
* ```
*
* @param argument A collection of arguments for invoking getTopic.
* @return A collection of values returned by getTopic.
*/
public suspend fun getTopic(argument: GetTopicPlainArgs): GetTopicResult =
getTopicResultToKotlin(getTopicPlain(argument.toJava()).await())
/**
* @see [getTopic].
* @param name The name of the Cloud Pub/Sub Topic.
* - - -
* @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 getTopic.
*/
public suspend fun getTopic(name: String, project: String? = null): GetTopicResult {
val argument = GetTopicPlainArgs(
name = name,
project = project,
)
return getTopicResultToKotlin(getTopicPlain(argument.toJava()).await())
}
/**
* @see [getTopic].
* @param argument Builder for [com.pulumi.gcp.pubsub.kotlin.inputs.GetTopicPlainArgs].
* @return A collection of values returned by getTopic.
*/
public suspend fun getTopic(argument: suspend GetTopicPlainArgsBuilder.() -> Unit): GetTopicResult {
val builder = GetTopicPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getTopicResultToKotlin(getTopicPlain(builtArgument.toJava()).await())
}
/**
* Retrieves the current IAM policy data for topic
* ## example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = gcp.pubsub.getTopicIamPolicy({
* project: example.project,
* topic: example.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.pubsub.get_topic_iam_policy(project=example["project"],
* topic=example["name"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = Gcp.PubSub.GetTopicIamPolicy.Invoke(new()
* {
* Project = example.Project,
* Topic = example.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/pubsub"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := pubsub.GetTopicIamPolicy(ctx, &pubsub.GetTopicIamPolicyArgs{
* Project: pulumi.StringRef(example.Project),
* Topic: example.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.pubsub.PubsubFunctions;
* import com.pulumi.gcp.pubsub.inputs.GetTopicIamPolicyArgs;
* 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 = PubsubFunctions.getTopicIamPolicy(GetTopicIamPolicyArgs.builder()
* .project(example.project())
* .topic(example.name())
* .build());
* }
* }
* ```
* ```yaml
* variables:
* policy:
* fn::invoke:
* Function: gcp:pubsub:getTopicIamPolicy
* Arguments:
* project: ${example.project}
* topic: ${example.name}
* ```
*
* @param argument A collection of arguments for invoking getTopicIamPolicy.
* @return A collection of values returned by getTopicIamPolicy.
*/
public suspend fun getTopicIamPolicy(argument: GetTopicIamPolicyPlainArgs): GetTopicIamPolicyResult =
getTopicIamPolicyResultToKotlin(getTopicIamPolicyPlain(argument.toJava()).await())
/**
* @see [getTopicIamPolicy].
* @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 topic Used to find the parent resource to bind the IAM policy to
* @return A collection of values returned by getTopicIamPolicy.
*/
public suspend fun getTopicIamPolicy(project: String? = null, topic: String): GetTopicIamPolicyResult {
val argument = GetTopicIamPolicyPlainArgs(
project = project,
topic = topic,
)
return getTopicIamPolicyResultToKotlin(getTopicIamPolicyPlain(argument.toJava()).await())
}
/**
* @see [getTopicIamPolicy].
* @param argument Builder for [com.pulumi.gcp.pubsub.kotlin.inputs.GetTopicIamPolicyPlainArgs].
* @return A collection of values returned by getTopicIamPolicy.
*/
public suspend fun getTopicIamPolicy(argument: suspend GetTopicIamPolicyPlainArgsBuilder.() -> Unit): GetTopicIamPolicyResult {
val builder = GetTopicIamPolicyPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getTopicIamPolicyResultToKotlin(getTopicIamPolicyPlain(builtArgument.toJava()).await())
}
}