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

com.pulumi.gcp.pubsub.kotlin.SubscriptionArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.pubsub.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.pubsub.SubscriptionArgs.builder
import com.pulumi.gcp.pubsub.kotlin.inputs.SubscriptionBigqueryConfigArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.SubscriptionBigqueryConfigArgsBuilder
import com.pulumi.gcp.pubsub.kotlin.inputs.SubscriptionCloudStorageConfigArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.SubscriptionCloudStorageConfigArgsBuilder
import com.pulumi.gcp.pubsub.kotlin.inputs.SubscriptionDeadLetterPolicyArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.SubscriptionDeadLetterPolicyArgsBuilder
import com.pulumi.gcp.pubsub.kotlin.inputs.SubscriptionExpirationPolicyArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.SubscriptionExpirationPolicyArgsBuilder
import com.pulumi.gcp.pubsub.kotlin.inputs.SubscriptionPushConfigArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.SubscriptionPushConfigArgsBuilder
import com.pulumi.gcp.pubsub.kotlin.inputs.SubscriptionRetryPolicyArgs
import com.pulumi.gcp.pubsub.kotlin.inputs.SubscriptionRetryPolicyArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * A named resource representing the stream of messages from a single,
 * specific topic, to be delivered to the subscribing application.
 * To get more information about Subscription, see:
 * * [API documentation](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.subscriptions)
 * * How-to Guides
 *     * [Managing Subscriptions](https://cloud.google.com/pubsub/docs/admin#managing_subscriptions)
 * > **Note:** You can retrieve the email of the Google Managed Pub/Sub Service Account used for forwarding
 * by using the `gcp.projects.ServiceIdentity` resource.
 * ## Example Usage
 * ### Pubsub Subscription Push
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const example = new gcp.pubsub.Topic("example", {name: "example-topic"});
 * const exampleSubscription = new gcp.pubsub.Subscription("example", {
 *     name: "example-subscription",
 *     topic: example.id,
 *     ackDeadlineSeconds: 20,
 *     labels: {
 *         foo: "bar",
 *     },
 *     pushConfig: {
 *         pushEndpoint: "https://example.com/push",
 *         attributes: {
 *             "x-goog-version": "v1",
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * example = gcp.pubsub.Topic("example", name="example-topic")
 * example_subscription = gcp.pubsub.Subscription("example",
 *     name="example-subscription",
 *     topic=example.id,
 *     ack_deadline_seconds=20,
 *     labels={
 *         "foo": "bar",
 *     },
 *     push_config={
 *         "push_endpoint": "https://example.com/push",
 *         "attributes": {
 *             "x-goog-version": "v1",
 *         },
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Gcp.PubSub.Topic("example", new()
 *     {
 *         Name = "example-topic",
 *     });
 *     var exampleSubscription = new Gcp.PubSub.Subscription("example", new()
 *     {
 *         Name = "example-subscription",
 *         Topic = example.Id,
 *         AckDeadlineSeconds = 20,
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         PushConfig = new Gcp.PubSub.Inputs.SubscriptionPushConfigArgs
 *         {
 *             PushEndpoint = "https://example.com/push",
 *             Attributes =
 *             {
 *                 { "x-goog-version", "v1" },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
 * 			Name: pulumi.String("example-topic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = pubsub.NewSubscription(ctx, "example", &pubsub.SubscriptionArgs{
 * 			Name:               pulumi.String("example-subscription"),
 * 			Topic:              example.ID(),
 * 			AckDeadlineSeconds: pulumi.Int(20),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			PushConfig: &pubsub.SubscriptionPushConfigArgs{
 * 				PushEndpoint: pulumi.String("https://example.com/push"),
 * 				Attributes: pulumi.StringMap{
 * 					"x-goog-version": pulumi.String("v1"),
 * 				},
 * 			},
 * 		})
 * 		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.Topic;
 * import com.pulumi.gcp.pubsub.TopicArgs;
 * import com.pulumi.gcp.pubsub.Subscription;
 * import com.pulumi.gcp.pubsub.SubscriptionArgs;
 * import com.pulumi.gcp.pubsub.inputs.SubscriptionPushConfigArgs;
 * 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) {
 *         var example = new Topic("example", TopicArgs.builder()
 *             .name("example-topic")
 *             .build());
 *         var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
 *             .name("example-subscription")
 *             .topic(example.id())
 *             .ackDeadlineSeconds(20)
 *             .labels(Map.of("foo", "bar"))
 *             .pushConfig(SubscriptionPushConfigArgs.builder()
 *                 .pushEndpoint("https://example.com/push")
 *                 .attributes(Map.of("x-goog-version", "v1"))
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:pubsub:Topic
 *     properties:
 *       name: example-topic
 *   exampleSubscription:
 *     type: gcp:pubsub:Subscription
 *     name: example
 *     properties:
 *       name: example-subscription
 *       topic: ${example.id}
 *       ackDeadlineSeconds: 20
 *       labels:
 *         foo: bar
 *       pushConfig:
 *         pushEndpoint: https://example.com/push
 *         attributes:
 *           x-goog-version: v1
 * ```
 * 
 * ### Pubsub Subscription Pull
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const example = new gcp.pubsub.Topic("example", {name: "example-topic"});
 * const exampleSubscription = new gcp.pubsub.Subscription("example", {
 *     name: "example-subscription",
 *     topic: example.id,
 *     labels: {
 *         foo: "bar",
 *     },
 *     messageRetentionDuration: "1200s",
 *     retainAckedMessages: true,
 *     ackDeadlineSeconds: 20,
 *     expirationPolicy: {
 *         ttl: "300000.5s",
 *     },
 *     retryPolicy: {
 *         minimumBackoff: "10s",
 *     },
 *     enableMessageOrdering: false,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * example = gcp.pubsub.Topic("example", name="example-topic")
 * example_subscription = gcp.pubsub.Subscription("example",
 *     name="example-subscription",
 *     topic=example.id,
 *     labels={
 *         "foo": "bar",
 *     },
 *     message_retention_duration="1200s",
 *     retain_acked_messages=True,
 *     ack_deadline_seconds=20,
 *     expiration_policy={
 *         "ttl": "300000.5s",
 *     },
 *     retry_policy={
 *         "minimum_backoff": "10s",
 *     },
 *     enable_message_ordering=False)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Gcp.PubSub.Topic("example", new()
 *     {
 *         Name = "example-topic",
 *     });
 *     var exampleSubscription = new Gcp.PubSub.Subscription("example", new()
 *     {
 *         Name = "example-subscription",
 *         Topic = example.Id,
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         MessageRetentionDuration = "1200s",
 *         RetainAckedMessages = true,
 *         AckDeadlineSeconds = 20,
 *         ExpirationPolicy = new Gcp.PubSub.Inputs.SubscriptionExpirationPolicyArgs
 *         {
 *             Ttl = "300000.5s",
 *         },
 *         RetryPolicy = new Gcp.PubSub.Inputs.SubscriptionRetryPolicyArgs
 *         {
 *             MinimumBackoff = "10s",
 *         },
 *         EnableMessageOrdering = false,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
 * 			Name: pulumi.String("example-topic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = pubsub.NewSubscription(ctx, "example", &pubsub.SubscriptionArgs{
 * 			Name:  pulumi.String("example-subscription"),
 * 			Topic: example.ID(),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			MessageRetentionDuration: pulumi.String("1200s"),
 * 			RetainAckedMessages:      pulumi.Bool(true),
 * 			AckDeadlineSeconds:       pulumi.Int(20),
 * 			ExpirationPolicy: &pubsub.SubscriptionExpirationPolicyArgs{
 * 				Ttl: pulumi.String("300000.5s"),
 * 			},
 * 			RetryPolicy: &pubsub.SubscriptionRetryPolicyArgs{
 * 				MinimumBackoff: pulumi.String("10s"),
 * 			},
 * 			EnableMessageOrdering: pulumi.Bool(false),
 * 		})
 * 		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.Topic;
 * import com.pulumi.gcp.pubsub.TopicArgs;
 * import com.pulumi.gcp.pubsub.Subscription;
 * import com.pulumi.gcp.pubsub.SubscriptionArgs;
 * import com.pulumi.gcp.pubsub.inputs.SubscriptionExpirationPolicyArgs;
 * import com.pulumi.gcp.pubsub.inputs.SubscriptionRetryPolicyArgs;
 * 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) {
 *         var example = new Topic("example", TopicArgs.builder()
 *             .name("example-topic")
 *             .build());
 *         var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
 *             .name("example-subscription")
 *             .topic(example.id())
 *             .labels(Map.of("foo", "bar"))
 *             .messageRetentionDuration("1200s")
 *             .retainAckedMessages(true)
 *             .ackDeadlineSeconds(20)
 *             .expirationPolicy(SubscriptionExpirationPolicyArgs.builder()
 *                 .ttl("300000.5s")
 *                 .build())
 *             .retryPolicy(SubscriptionRetryPolicyArgs.builder()
 *                 .minimumBackoff("10s")
 *                 .build())
 *             .enableMessageOrdering(false)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:pubsub:Topic
 *     properties:
 *       name: example-topic
 *   exampleSubscription:
 *     type: gcp:pubsub:Subscription
 *     name: example
 *     properties:
 *       name: example-subscription
 *       topic: ${example.id}
 *       labels:
 *         foo: bar
 *       messageRetentionDuration: 1200s
 *       retainAckedMessages: true
 *       ackDeadlineSeconds: 20
 *       expirationPolicy:
 *         ttl: 300000.5s
 *       retryPolicy:
 *         minimumBackoff: 10s
 *       enableMessageOrdering: false
 * ```
 * 
 * ### Pubsub Subscription Pull Filter
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const example = new gcp.pubsub.Topic("example", {name: "example-topic"});
 * const exampleSubscription = new gcp.pubsub.Subscription("example", {
 *     name: "example-subscription",
 *     topic: example.id,
 *     labels: {
 *         foo: "bar",
 *     },
 *     filter: `    attributes.foo = "foo"
 *     AND attributes.bar = "bar"
 * `,
 *     ackDeadlineSeconds: 20,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * example = gcp.pubsub.Topic("example", name="example-topic")
 * example_subscription = gcp.pubsub.Subscription("example",
 *     name="example-subscription",
 *     topic=example.id,
 *     labels={
 *         "foo": "bar",
 *     },
 *     filter="""    attributes.foo = "foo"
 *     AND attributes.bar = "bar"
 * """,
 *     ack_deadline_seconds=20)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Gcp.PubSub.Topic("example", new()
 *     {
 *         Name = "example-topic",
 *     });
 *     var exampleSubscription = new Gcp.PubSub.Subscription("example", new()
 *     {
 *         Name = "example-subscription",
 *         Topic = example.Id,
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         Filter = @"    attributes.foo = ""foo""
 *     AND attributes.bar = ""bar""
 * ",
 *         AckDeadlineSeconds = 20,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
 * 			Name: pulumi.String("example-topic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = pubsub.NewSubscription(ctx, "example", &pubsub.SubscriptionArgs{
 * 			Name:  pulumi.String("example-subscription"),
 * 			Topic: example.ID(),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			Filter:             pulumi.String("    attributes.foo = \"foo\"\n    AND attributes.bar = \"bar\"\n"),
 * 			AckDeadlineSeconds: pulumi.Int(20),
 * 		})
 * 		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.Topic;
 * import com.pulumi.gcp.pubsub.TopicArgs;
 * import com.pulumi.gcp.pubsub.Subscription;
 * import com.pulumi.gcp.pubsub.SubscriptionArgs;
 * 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) {
 *         var example = new Topic("example", TopicArgs.builder()
 *             .name("example-topic")
 *             .build());
 *         var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
 *             .name("example-subscription")
 *             .topic(example.id())
 *             .labels(Map.of("foo", "bar"))
 *             .filter("""
 *     attributes.foo = "foo"
 *     AND attributes.bar = "bar"
 *             """)
 *             .ackDeadlineSeconds(20)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:pubsub:Topic
 *     properties:
 *       name: example-topic
 *   exampleSubscription:
 *     type: gcp:pubsub:Subscription
 *     name: example
 *     properties:
 *       name: example-subscription
 *       topic: ${example.id}
 *       labels:
 *         foo: bar
 *       filter: |2
 *             attributes.foo = "foo"
 *             AND attributes.bar = "bar"
 *       ackDeadlineSeconds: 20
 * ```
 * 
 * ### Pubsub Subscription Dead Letter
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const example = new gcp.pubsub.Topic("example", {name: "example-topic"});
 * const exampleDeadLetter = new gcp.pubsub.Topic("example_dead_letter", {name: "example-topic-dead-letter"});
 * const exampleSubscription = new gcp.pubsub.Subscription("example", {
 *     name: "example-subscription",
 *     topic: example.id,
 *     deadLetterPolicy: {
 *         deadLetterTopic: exampleDeadLetter.id,
 *         maxDeliveryAttempts: 10,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * example = gcp.pubsub.Topic("example", name="example-topic")
 * example_dead_letter = gcp.pubsub.Topic("example_dead_letter", name="example-topic-dead-letter")
 * example_subscription = gcp.pubsub.Subscription("example",
 *     name="example-subscription",
 *     topic=example.id,
 *     dead_letter_policy={
 *         "dead_letter_topic": example_dead_letter.id,
 *         "max_delivery_attempts": 10,
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Gcp.PubSub.Topic("example", new()
 *     {
 *         Name = "example-topic",
 *     });
 *     var exampleDeadLetter = new Gcp.PubSub.Topic("example_dead_letter", new()
 *     {
 *         Name = "example-topic-dead-letter",
 *     });
 *     var exampleSubscription = new Gcp.PubSub.Subscription("example", new()
 *     {
 *         Name = "example-subscription",
 *         Topic = example.Id,
 *         DeadLetterPolicy = new Gcp.PubSub.Inputs.SubscriptionDeadLetterPolicyArgs
 *         {
 *             DeadLetterTopic = exampleDeadLetter.Id,
 *             MaxDeliveryAttempts = 10,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
 * 			Name: pulumi.String("example-topic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleDeadLetter, err := pubsub.NewTopic(ctx, "example_dead_letter", &pubsub.TopicArgs{
 * 			Name: pulumi.String("example-topic-dead-letter"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = pubsub.NewSubscription(ctx, "example", &pubsub.SubscriptionArgs{
 * 			Name:  pulumi.String("example-subscription"),
 * 			Topic: example.ID(),
 * 			DeadLetterPolicy: &pubsub.SubscriptionDeadLetterPolicyArgs{
 * 				DeadLetterTopic:     exampleDeadLetter.ID(),
 * 				MaxDeliveryAttempts: pulumi.Int(10),
 * 			},
 * 		})
 * 		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.Topic;
 * import com.pulumi.gcp.pubsub.TopicArgs;
 * import com.pulumi.gcp.pubsub.Subscription;
 * import com.pulumi.gcp.pubsub.SubscriptionArgs;
 * import com.pulumi.gcp.pubsub.inputs.SubscriptionDeadLetterPolicyArgs;
 * 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) {
 *         var example = new Topic("example", TopicArgs.builder()
 *             .name("example-topic")
 *             .build());
 *         var exampleDeadLetter = new Topic("exampleDeadLetter", TopicArgs.builder()
 *             .name("example-topic-dead-letter")
 *             .build());
 *         var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
 *             .name("example-subscription")
 *             .topic(example.id())
 *             .deadLetterPolicy(SubscriptionDeadLetterPolicyArgs.builder()
 *                 .deadLetterTopic(exampleDeadLetter.id())
 *                 .maxDeliveryAttempts(10)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:pubsub:Topic
 *     properties:
 *       name: example-topic
 *   exampleDeadLetter:
 *     type: gcp:pubsub:Topic
 *     name: example_dead_letter
 *     properties:
 *       name: example-topic-dead-letter
 *   exampleSubscription:
 *     type: gcp:pubsub:Subscription
 *     name: example
 *     properties:
 *       name: example-subscription
 *       topic: ${example.id}
 *       deadLetterPolicy:
 *         deadLetterTopic: ${exampleDeadLetter.id}
 *         maxDeliveryAttempts: 10
 * ```
 * 
 * ### Pubsub Subscription Push Bq
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const example = new gcp.pubsub.Topic("example", {name: "example-topic"});
 * const test = new gcp.bigquery.Dataset("test", {datasetId: "example_dataset"});
 * const testTable = new gcp.bigquery.Table("test", {
 *     tableId: "example_table",
 *     datasetId: test.datasetId,
 *     schema: `[
 *   {
 *     "name": "data",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The data"
 *   }
 * ]
 * `,
 *     deletionProtection: false,
 * });
 * const exampleSubscription = new gcp.pubsub.Subscription("example", {
 *     name: "example-subscription",
 *     topic: example.id,
 *     bigqueryConfig: {
 *         table: pulumi.interpolate`${testTable.project}.${testTable.datasetId}.${testTable.tableId}`,
 *     },
 * });
 * const project = gcp.organizations.getProject({});
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * example = gcp.pubsub.Topic("example", name="example-topic")
 * test = gcp.bigquery.Dataset("test", dataset_id="example_dataset")
 * test_table = gcp.bigquery.Table("test",
 *     table_id="example_table",
 *     dataset_id=test.dataset_id,
 *     schema="""[
 *   {
 *     "name": "data",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The data"
 *   }
 * ]
 * """,
 *     deletion_protection=False)
 * example_subscription = gcp.pubsub.Subscription("example",
 *     name="example-subscription",
 *     topic=example.id,
 *     bigquery_config={
 *         "table": pulumi.Output.all(
 *             project=test_table.project,
 *             dataset_id=test_table.dataset_id,
 *             table_id=test_table.table_id
 * ).apply(lambda resolved_outputs: f"{resolved_outputs['project']}.{resolved_outputs['dataset_id']}.{resolved_outputs['table_id']}")
 * ,
 *     })
 * project = gcp.organizations.get_project()
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Gcp.PubSub.Topic("example", new()
 *     {
 *         Name = "example-topic",
 *     });
 *     var test = new Gcp.BigQuery.Dataset("test", new()
 *     {
 *         DatasetId = "example_dataset",
 *     });
 *     var testTable = new Gcp.BigQuery.Table("test", new()
 *     {
 *         TableId = "example_table",
 *         DatasetId = test.DatasetId,
 *         Schema = @"[
 *   {
 *     ""name"": ""data"",
 *     ""type"": ""STRING"",
 *     ""mode"": ""NULLABLE"",
 *     ""description"": ""The data""
 *   }
 * ]
 * ",
 *         DeletionProtection = false,
 *     });
 *     var exampleSubscription = new Gcp.PubSub.Subscription("example", new()
 *     {
 *         Name = "example-subscription",
 *         Topic = example.Id,
 *         BigqueryConfig = new Gcp.PubSub.Inputs.SubscriptionBigqueryConfigArgs
 *         {
 *             Table = Output.Tuple(testTable.Project, testTable.DatasetId, testTable.TableId).Apply(values =>
 *             {
 *                 var project = values.Item1;
 *                 var datasetId = values.Item2;
 *                 var tableId = values.Item3;
 *                 return $"{project}.{datasetId}.{tableId}";
 *             }),
 *         },
 *     });
 *     var project = Gcp.Organizations.GetProject.Invoke();
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/bigquery"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
 * 			Name: pulumi.String("example-topic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		test, err := bigquery.NewDataset(ctx, "test", &bigquery.DatasetArgs{
 * 			DatasetId: pulumi.String("example_dataset"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		testTable, err := bigquery.NewTable(ctx, "test", &bigquery.TableArgs{
 * 			TableId:   pulumi.String("example_table"),
 * 			DatasetId: test.DatasetId,
 * 			Schema: pulumi.String(`[
 *   {
 *     "name": "data",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The data"
 *   }
 * ]
 * `),
 * 			DeletionProtection: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = pubsub.NewSubscription(ctx, "example", &pubsub.SubscriptionArgs{
 * 			Name:  pulumi.String("example-subscription"),
 * 			Topic: example.ID(),
 * 			BigqueryConfig: &pubsub.SubscriptionBigqueryConfigArgs{
 * 				Table: pulumi.All(testTable.Project, testTable.DatasetId, testTable.TableId).ApplyT(func(_args []interface{}) (string, error) {
 * 					project := _args[0].(string)
 * 					datasetId := _args[1].(string)
 * 					tableId := _args[2].(string)
 * 					return fmt.Sprintf("%v.%v.%v", project, datasetId, tableId), nil
 * 				}).(pulumi.StringOutput),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, 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.Topic;
 * import com.pulumi.gcp.pubsub.TopicArgs;
 * import com.pulumi.gcp.bigquery.Dataset;
 * import com.pulumi.gcp.bigquery.DatasetArgs;
 * import com.pulumi.gcp.bigquery.Table;
 * import com.pulumi.gcp.bigquery.TableArgs;
 * import com.pulumi.gcp.pubsub.Subscription;
 * import com.pulumi.gcp.pubsub.SubscriptionArgs;
 * import com.pulumi.gcp.pubsub.inputs.SubscriptionBigqueryConfigArgs;
 * import com.pulumi.gcp.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * 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) {
 *         var example = new Topic("example", TopicArgs.builder()
 *             .name("example-topic")
 *             .build());
 *         var test = new Dataset("test", DatasetArgs.builder()
 *             .datasetId("example_dataset")
 *             .build());
 *         var testTable = new Table("testTable", TableArgs.builder()
 *             .tableId("example_table")
 *             .datasetId(test.datasetId())
 *             .schema("""
 * [
 *   {
 *     "name": "data",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The data"
 *   }
 * ]
 *             """)
 *             .deletionProtection(false)
 *             .build());
 *         var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
 *             .name("example-subscription")
 *             .topic(example.id())
 *             .bigqueryConfig(SubscriptionBigqueryConfigArgs.builder()
 *                 .table(Output.tuple(testTable.project(), testTable.datasetId(), testTable.tableId()).applyValue(values -> {
 *                     var project = values.t1;
 *                     var datasetId = values.t2;
 *                     var tableId = values.t3;
 *                     return String.format("%s.%s.%s", project,datasetId,tableId);
 *                 }))
 *                 .build())
 *             .build());
 *         final var project = OrganizationsFunctions.getProject();
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:pubsub:Topic
 *     properties:
 *       name: example-topic
 *   exampleSubscription:
 *     type: gcp:pubsub:Subscription
 *     name: example
 *     properties:
 *       name: example-subscription
 *       topic: ${example.id}
 *       bigqueryConfig:
 *         table: ${testTable.project}.${testTable.datasetId}.${testTable.tableId}
 *   test:
 *     type: gcp:bigquery:Dataset
 *     properties:
 *       datasetId: example_dataset
 *   testTable:
 *     type: gcp:bigquery:Table
 *     name: test
 *     properties:
 *       tableId: example_table
 *       datasetId: ${test.datasetId}
 *       schema: |
 *         [
 *           {
 *             "name": "data",
 *             "type": "STRING",
 *             "mode": "NULLABLE",
 *             "description": "The data"
 *           }
 *         ]
 *       deletionProtection: false
 * variables:
 *   project:
 *     fn::invoke:
 *       function: gcp:organizations:getProject
 *       arguments: {}
 * ```
 * 
 * ### Pubsub Subscription Push Bq Table Schema
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const example = new gcp.pubsub.Topic("example", {name: "example-topic"});
 * const test = new gcp.bigquery.Dataset("test", {datasetId: "example_dataset"});
 * const testTable = new gcp.bigquery.Table("test", {
 *     tableId: "example_table",
 *     datasetId: test.datasetId,
 *     schema: `[
 *   {
 *     "name": "data",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The data"
 *   }
 * ]
 * `,
 *     deletionProtection: false,
 * });
 * const exampleSubscription = new gcp.pubsub.Subscription("example", {
 *     name: "example-subscription",
 *     topic: example.id,
 *     bigqueryConfig: {
 *         table: pulumi.interpolate`${testTable.project}.${testTable.datasetId}.${testTable.tableId}`,
 *         useTableSchema: true,
 *     },
 * });
 * const project = gcp.organizations.getProject({});
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * example = gcp.pubsub.Topic("example", name="example-topic")
 * test = gcp.bigquery.Dataset("test", dataset_id="example_dataset")
 * test_table = gcp.bigquery.Table("test",
 *     table_id="example_table",
 *     dataset_id=test.dataset_id,
 *     schema="""[
 *   {
 *     "name": "data",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The data"
 *   }
 * ]
 * """,
 *     deletion_protection=False)
 * example_subscription = gcp.pubsub.Subscription("example",
 *     name="example-subscription",
 *     topic=example.id,
 *     bigquery_config={
 *         "table": pulumi.Output.all(
 *             project=test_table.project,
 *             dataset_id=test_table.dataset_id,
 *             table_id=test_table.table_id
 * ).apply(lambda resolved_outputs: f"{resolved_outputs['project']}.{resolved_outputs['dataset_id']}.{resolved_outputs['table_id']}")
 * ,
 *         "use_table_schema": True,
 *     })
 * project = gcp.organizations.get_project()
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Gcp.PubSub.Topic("example", new()
 *     {
 *         Name = "example-topic",
 *     });
 *     var test = new Gcp.BigQuery.Dataset("test", new()
 *     {
 *         DatasetId = "example_dataset",
 *     });
 *     var testTable = new Gcp.BigQuery.Table("test", new()
 *     {
 *         TableId = "example_table",
 *         DatasetId = test.DatasetId,
 *         Schema = @"[
 *   {
 *     ""name"": ""data"",
 *     ""type"": ""STRING"",
 *     ""mode"": ""NULLABLE"",
 *     ""description"": ""The data""
 *   }
 * ]
 * ",
 *         DeletionProtection = false,
 *     });
 *     var exampleSubscription = new Gcp.PubSub.Subscription("example", new()
 *     {
 *         Name = "example-subscription",
 *         Topic = example.Id,
 *         BigqueryConfig = new Gcp.PubSub.Inputs.SubscriptionBigqueryConfigArgs
 *         {
 *             Table = Output.Tuple(testTable.Project, testTable.DatasetId, testTable.TableId).Apply(values =>
 *             {
 *                 var project = values.Item1;
 *                 var datasetId = values.Item2;
 *                 var tableId = values.Item3;
 *                 return $"{project}.{datasetId}.{tableId}";
 *             }),
 *             UseTableSchema = true,
 *         },
 *     });
 *     var project = Gcp.Organizations.GetProject.Invoke();
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/bigquery"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
 * 			Name: pulumi.String("example-topic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		test, err := bigquery.NewDataset(ctx, "test", &bigquery.DatasetArgs{
 * 			DatasetId: pulumi.String("example_dataset"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		testTable, err := bigquery.NewTable(ctx, "test", &bigquery.TableArgs{
 * 			TableId:   pulumi.String("example_table"),
 * 			DatasetId: test.DatasetId,
 * 			Schema: pulumi.String(`[
 *   {
 *     "name": "data",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The data"
 *   }
 * ]
 * `),
 * 			DeletionProtection: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = pubsub.NewSubscription(ctx, "example", &pubsub.SubscriptionArgs{
 * 			Name:  pulumi.String("example-subscription"),
 * 			Topic: example.ID(),
 * 			BigqueryConfig: &pubsub.SubscriptionBigqueryConfigArgs{
 * 				Table: pulumi.All(testTable.Project, testTable.DatasetId, testTable.TableId).ApplyT(func(_args []interface{}) (string, error) {
 * 					project := _args[0].(string)
 * 					datasetId := _args[1].(string)
 * 					tableId := _args[2].(string)
 * 					return fmt.Sprintf("%v.%v.%v", project, datasetId, tableId), nil
 * 				}).(pulumi.StringOutput),
 * 				UseTableSchema: pulumi.Bool(true),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, 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.Topic;
 * import com.pulumi.gcp.pubsub.TopicArgs;
 * import com.pulumi.gcp.bigquery.Dataset;
 * import com.pulumi.gcp.bigquery.DatasetArgs;
 * import com.pulumi.gcp.bigquery.Table;
 * import com.pulumi.gcp.bigquery.TableArgs;
 * import com.pulumi.gcp.pubsub.Subscription;
 * import com.pulumi.gcp.pubsub.SubscriptionArgs;
 * import com.pulumi.gcp.pubsub.inputs.SubscriptionBigqueryConfigArgs;
 * import com.pulumi.gcp.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * 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) {
 *         var example = new Topic("example", TopicArgs.builder()
 *             .name("example-topic")
 *             .build());
 *         var test = new Dataset("test", DatasetArgs.builder()
 *             .datasetId("example_dataset")
 *             .build());
 *         var testTable = new Table("testTable", TableArgs.builder()
 *             .tableId("example_table")
 *             .datasetId(test.datasetId())
 *             .schema("""
 * [
 *   {
 *     "name": "data",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The data"
 *   }
 * ]
 *             """)
 *             .deletionProtection(false)
 *             .build());
 *         var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
 *             .name("example-subscription")
 *             .topic(example.id())
 *             .bigqueryConfig(SubscriptionBigqueryConfigArgs.builder()
 *                 .table(Output.tuple(testTable.project(), testTable.datasetId(), testTable.tableId()).applyValue(values -> {
 *                     var project = values.t1;
 *                     var datasetId = values.t2;
 *                     var tableId = values.t3;
 *                     return String.format("%s.%s.%s", project,datasetId,tableId);
 *                 }))
 *                 .useTableSchema(true)
 *                 .build())
 *             .build());
 *         final var project = OrganizationsFunctions.getProject();
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:pubsub:Topic
 *     properties:
 *       name: example-topic
 *   exampleSubscription:
 *     type: gcp:pubsub:Subscription
 *     name: example
 *     properties:
 *       name: example-subscription
 *       topic: ${example.id}
 *       bigqueryConfig:
 *         table: ${testTable.project}.${testTable.datasetId}.${testTable.tableId}
 *         useTableSchema: true
 *   test:
 *     type: gcp:bigquery:Dataset
 *     properties:
 *       datasetId: example_dataset
 *   testTable:
 *     type: gcp:bigquery:Table
 *     name: test
 *     properties:
 *       tableId: example_table
 *       datasetId: ${test.datasetId}
 *       schema: |
 *         [
 *           {
 *             "name": "data",
 *             "type": "STRING",
 *             "mode": "NULLABLE",
 *             "description": "The data"
 *           }
 *         ]
 *       deletionProtection: false
 * variables:
 *   project:
 *     fn::invoke:
 *       function: gcp:organizations:getProject
 *       arguments: {}
 * ```
 * 
 * ### Pubsub Subscription Push Bq Service Account
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const example = new gcp.pubsub.Topic("example", {name: "example-topic"});
 * const bqWriteServiceAccount = new gcp.serviceaccount.Account("bq_write_service_account", {
 *     accountId: "example-bqw",
 *     displayName: "BQ Write Service Account",
 * });
 * const project = gcp.organizations.getProject({});
 * const bigqueryMetadataViewer = new gcp.projects.IAMMember("bigquery_metadata_viewer", {
 *     project: project.then(project => project.projectId),
 *     role: "roles/bigquery.metadataViewer",
 *     member: pulumi.interpolate`serviceAccount:${bqWriteServiceAccount.email}`,
 * });
 * const bigqueryDataEditor = new gcp.projects.IAMMember("bigquery_data_editor", {
 *     project: project.then(project => project.projectId),
 *     role: "roles/bigquery.dataEditor",
 *     member: pulumi.interpolate`serviceAccount:${bqWriteServiceAccount.email}`,
 * });
 * const test = new gcp.bigquery.Dataset("test", {datasetId: "example_dataset"});
 * const testTable = new gcp.bigquery.Table("test", {
 *     deletionProtection: false,
 *     tableId: "example_table",
 *     datasetId: test.datasetId,
 *     schema: `[
 *   {
 *     "name": "data",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The data"
 *   }
 * ]
 * `,
 * });
 * const exampleSubscription = new gcp.pubsub.Subscription("example", {
 *     name: "example-subscription",
 *     topic: example.id,
 *     bigqueryConfig: {
 *         table: pulumi.interpolate`${testTable.project}.${testTable.datasetId}.${testTable.tableId}`,
 *         serviceAccountEmail: bqWriteServiceAccount.email,
 *     },
 * }, {
 *     dependsOn: [
 *         bqWriteServiceAccount,
 *         bigqueryMetadataViewer,
 *         bigqueryDataEditor,
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * example = gcp.pubsub.Topic("example", name="example-topic")
 * bq_write_service_account = gcp.serviceaccount.Account("bq_write_service_account",
 *     account_id="example-bqw",
 *     display_name="BQ Write Service Account")
 * project = gcp.organizations.get_project()
 * bigquery_metadata_viewer = gcp.projects.IAMMember("bigquery_metadata_viewer",
 *     project=project.project_id,
 *     role="roles/bigquery.metadataViewer",
 *     member=bq_write_service_account.email.apply(lambda email: f"serviceAccount:{email}"))
 * bigquery_data_editor = gcp.projects.IAMMember("bigquery_data_editor",
 *     project=project.project_id,
 *     role="roles/bigquery.dataEditor",
 *     member=bq_write_service_account.email.apply(lambda email: f"serviceAccount:{email}"))
 * test = gcp.bigquery.Dataset("test", dataset_id="example_dataset")
 * test_table = gcp.bigquery.Table("test",
 *     deletion_protection=False,
 *     table_id="example_table",
 *     dataset_id=test.dataset_id,
 *     schema="""[
 *   {
 *     "name": "data",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The data"
 *   }
 * ]
 * """)
 * example_subscription = gcp.pubsub.Subscription("example",
 *     name="example-subscription",
 *     topic=example.id,
 *     bigquery_config={
 *         "table": pulumi.Output.all(
 *             project=test_table.project,
 *             dataset_id=test_table.dataset_id,
 *             table_id=test_table.table_id
 * ).apply(lambda resolved_outputs: f"{resolved_outputs['project']}.{resolved_outputs['dataset_id']}.{resolved_outputs['table_id']}")
 * ,
 *         "service_account_email": bq_write_service_account.email,
 *     },
 *     opts = pulumi.ResourceOptions(depends_on=[
 *             bq_write_service_account,
 *             bigquery_metadata_viewer,
 *             bigquery_data_editor,
 *         ]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Gcp.PubSub.Topic("example", new()
 *     {
 *         Name = "example-topic",
 *     });
 *     var bqWriteServiceAccount = new Gcp.ServiceAccount.Account("bq_write_service_account", new()
 *     {
 *         AccountId = "example-bqw",
 *         DisplayName = "BQ Write Service Account",
 *     });
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var bigqueryMetadataViewer = new Gcp.Projects.IAMMember("bigquery_metadata_viewer", new()
 *     {
 *         Project = project.Apply(getProjectResult => getProjectResult.ProjectId),
 *         Role = "roles/bigquery.metadataViewer",
 *         Member = bqWriteServiceAccount.Email.Apply(email => $"serviceAccount:{email}"),
 *     });
 *     var bigqueryDataEditor = new Gcp.Projects.IAMMember("bigquery_data_editor", new()
 *     {
 *         Project = project.Apply(getProjectResult => getProjectResult.ProjectId),
 *         Role = "roles/bigquery.dataEditor",
 *         Member = bqWriteServiceAccount.Email.Apply(email => $"serviceAccount:{email}"),
 *     });
 *     var test = new Gcp.BigQuery.Dataset("test", new()
 *     {
 *         DatasetId = "example_dataset",
 *     });
 *     var testTable = new Gcp.BigQuery.Table("test", new()
 *     {
 *         DeletionProtection = false,
 *         TableId = "example_table",
 *         DatasetId = test.DatasetId,
 *         Schema = @"[
 *   {
 *     ""name"": ""data"",
 *     ""type"": ""STRING"",
 *     ""mode"": ""NULLABLE"",
 *     ""description"": ""The data""
 *   }
 * ]
 * ",
 *     });
 *     var exampleSubscription = new Gcp.PubSub.Subscription("example", new()
 *     {
 *         Name = "example-subscription",
 *         Topic = example.Id,
 *         BigqueryConfig = new Gcp.PubSub.Inputs.SubscriptionBigqueryConfigArgs
 *         {
 *             Table = Output.Tuple(testTable.Project, testTable.DatasetId, testTable.TableId).Apply(values =>
 *             {
 *                 var project = values.Item1;
 *                 var datasetId = values.Item2;
 *                 var tableId = values.Item3;
 *                 return $"{project}.{datasetId}.{tableId}";
 *             }),
 *             ServiceAccountEmail = bqWriteServiceAccount.Email,
 *         },
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             bqWriteServiceAccount,
 *             bigqueryMetadataViewer,
 *             bigqueryDataEditor,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/bigquery"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/projects"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/serviceaccount"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
 * 			Name: pulumi.String("example-topic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		bqWriteServiceAccount, err := serviceaccount.NewAccount(ctx, "bq_write_service_account", &serviceaccount.AccountArgs{
 * 			AccountId:   pulumi.String("example-bqw"),
 * 			DisplayName: pulumi.String("BQ Write Service Account"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		project, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		bigqueryMetadataViewer, err := projects.NewIAMMember(ctx, "bigquery_metadata_viewer", &projects.IAMMemberArgs{
 * 			Project: pulumi.String(project.ProjectId),
 * 			Role:    pulumi.String("roles/bigquery.metadataViewer"),
 * 			Member: bqWriteServiceAccount.Email.ApplyT(func(email string) (string, error) {
 * 				return fmt.Sprintf("serviceAccount:%v", email), nil
 * 			}).(pulumi.StringOutput),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		bigqueryDataEditor, err := projects.NewIAMMember(ctx, "bigquery_data_editor", &projects.IAMMemberArgs{
 * 			Project: pulumi.String(project.ProjectId),
 * 			Role:    pulumi.String("roles/bigquery.dataEditor"),
 * 			Member: bqWriteServiceAccount.Email.ApplyT(func(email string) (string, error) {
 * 				return fmt.Sprintf("serviceAccount:%v", email), nil
 * 			}).(pulumi.StringOutput),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		test, err := bigquery.NewDataset(ctx, "test", &bigquery.DatasetArgs{
 * 			DatasetId: pulumi.String("example_dataset"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		testTable, err := bigquery.NewTable(ctx, "test", &bigquery.TableArgs{
 * 			DeletionProtection: pulumi.Bool(false),
 * 			TableId:            pulumi.String("example_table"),
 * 			DatasetId:          test.DatasetId,
 * 			Schema: pulumi.String(`[
 *   {
 *     "name": "data",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The data"
 *   }
 * ]
 * `),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = pubsub.NewSubscription(ctx, "example", &pubsub.SubscriptionArgs{
 * 			Name:  pulumi.String("example-subscription"),
 * 			Topic: example.ID(),
 * 			BigqueryConfig: &pubsub.SubscriptionBigqueryConfigArgs{
 * 				Table: pulumi.All(testTable.Project, testTable.DatasetId, testTable.TableId).ApplyT(func(_args []interface{}) (string, error) {
 * 					project := _args[0].(string)
 * 					datasetId := _args[1].(string)
 * 					tableId := _args[2].(string)
 * 					return fmt.Sprintf("%v.%v.%v", project, datasetId, tableId), nil
 * 				}).(pulumi.StringOutput),
 * 				ServiceAccountEmail: bqWriteServiceAccount.Email,
 * 			},
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			bqWriteServiceAccount,
 * 			bigqueryMetadataViewer,
 * 			bigqueryDataEditor,
 * 		}))
 * 		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.Topic;
 * import com.pulumi.gcp.pubsub.TopicArgs;
 * import com.pulumi.gcp.serviceaccount.Account;
 * import com.pulumi.gcp.serviceaccount.AccountArgs;
 * import com.pulumi.gcp.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.projects.IAMMember;
 * import com.pulumi.gcp.projects.IAMMemberArgs;
 * import com.pulumi.gcp.bigquery.Dataset;
 * import com.pulumi.gcp.bigquery.DatasetArgs;
 * import com.pulumi.gcp.bigquery.Table;
 * import com.pulumi.gcp.bigquery.TableArgs;
 * import com.pulumi.gcp.pubsub.Subscription;
 * import com.pulumi.gcp.pubsub.SubscriptionArgs;
 * import com.pulumi.gcp.pubsub.inputs.SubscriptionBigqueryConfigArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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) {
 *         var example = new Topic("example", TopicArgs.builder()
 *             .name("example-topic")
 *             .build());
 *         var bqWriteServiceAccount = new Account("bqWriteServiceAccount", AccountArgs.builder()
 *             .accountId("example-bqw")
 *             .displayName("BQ Write Service Account")
 *             .build());
 *         final var project = OrganizationsFunctions.getProject();
 *         var bigqueryMetadataViewer = new IAMMember("bigqueryMetadataViewer", IAMMemberArgs.builder()
 *             .project(project.applyValue(getProjectResult -> getProjectResult.projectId()))
 *             .role("roles/bigquery.metadataViewer")
 *             .member(bqWriteServiceAccount.email().applyValue(email -> String.format("serviceAccount:%s", email)))
 *             .build());
 *         var bigqueryDataEditor = new IAMMember("bigqueryDataEditor", IAMMemberArgs.builder()
 *             .project(project.applyValue(getProjectResult -> getProjectResult.projectId()))
 *             .role("roles/bigquery.dataEditor")
 *             .member(bqWriteServiceAccount.email().applyValue(email -> String.format("serviceAccount:%s", email)))
 *             .build());
 *         var test = new Dataset("test", DatasetArgs.builder()
 *             .datasetId("example_dataset")
 *             .build());
 *         var testTable = new Table("testTable", TableArgs.builder()
 *             .deletionProtection(false)
 *             .tableId("example_table")
 *             .datasetId(test.datasetId())
 *             .schema("""
 * [
 *   {
 *     "name": "data",
 *     "type": "STRING",
 *     "mode": "NULLABLE",
 *     "description": "The data"
 *   }
 * ]
 *             """)
 *             .build());
 *         var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
 *             .name("example-subscription")
 *             .topic(example.id())
 *             .bigqueryConfig(SubscriptionBigqueryConfigArgs.builder()
 *                 .table(Output.tuple(testTable.project(), testTable.datasetId(), testTable.tableId()).applyValue(values -> {
 *                     var project = values.t1;
 *                     var datasetId = values.t2;
 *                     var tableId = values.t3;
 *                     return String.format("%s.%s.%s", project.applyValue(getProjectResult -> getProjectResult),datasetId,tableId);
 *                 }))
 *                 .serviceAccountEmail(bqWriteServiceAccount.email())
 *                 .build())
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(
 *                     bqWriteServiceAccount,
 *                     bigqueryMetadataViewer,
 *                     bigqueryDataEditor)
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:pubsub:Topic
 *     properties:
 *       name: example-topic
 *   exampleSubscription:
 *     type: gcp:pubsub:Subscription
 *     name: example
 *     properties:
 *       name: example-subscription
 *       topic: ${example.id}
 *       bigqueryConfig:
 *         table: ${testTable.project}.${testTable.datasetId}.${testTable.tableId}
 *         serviceAccountEmail: ${bqWriteServiceAccount.email}
 *     options:
 *       dependsOn:
 *         - ${bqWriteServiceAccount}
 *         - ${bigqueryMetadataViewer}
 *         - ${bigqueryDataEditor}
 *   bqWriteServiceAccount:
 *     type: gcp:serviceaccount:Account
 *     name: bq_write_service_account
 *     properties:
 *       accountId: example-bqw
 *       displayName: BQ Write Service Account
 *   bigqueryMetadataViewer:
 *     type: gcp:projects:IAMMember
 *     name: bigquery_metadata_viewer
 *     properties:
 *       project: ${project.projectId}
 *       role: roles/bigquery.metadataViewer
 *       member: serviceAccount:${bqWriteServiceAccount.email}
 *   bigqueryDataEditor:
 *     type: gcp:projects:IAMMember
 *     name: bigquery_data_editor
 *     properties:
 *       project: ${project.projectId}
 *       role: roles/bigquery.dataEditor
 *       member: serviceAccount:${bqWriteServiceAccount.email}
 *   test:
 *     type: gcp:bigquery:Dataset
 *     properties:
 *       datasetId: example_dataset
 *   testTable:
 *     type: gcp:bigquery:Table
 *     name: test
 *     properties:
 *       deletionProtection: false
 *       tableId: example_table
 *       datasetId: ${test.datasetId}
 *       schema: |
 *         [
 *           {
 *             "name": "data",
 *             "type": "STRING",
 *             "mode": "NULLABLE",
 *             "description": "The data"
 *           }
 *         ]
 * variables:
 *   project:
 *     fn::invoke:
 *       function: gcp:organizations:getProject
 *       arguments: {}
 * ```
 * 
 * ### Pubsub Subscription Push Cloudstorage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const example = new gcp.storage.Bucket("example", {
 *     name: "example-bucket",
 *     location: "US",
 *     uniformBucketLevelAccess: true,
 * });
 * const exampleTopic = new gcp.pubsub.Topic("example", {name: "example-topic"});
 * const project = gcp.organizations.getProject({});
 * const admin = new gcp.storage.BucketIAMMember("admin", {
 *     bucket: example.name,
 *     role: "roles/storage.admin",
 *     member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-pubsub.iam.gserviceaccount.com`),
 * });
 * const exampleSubscription = new gcp.pubsub.Subscription("example", {
 *     name: "example-subscription",
 *     topic: exampleTopic.id,
 *     cloudStorageConfig: {
 *         bucket: example.name,
 *         filenamePrefix: "pre-",
 *         filenameSuffix: "-_33395",
 *         filenameDatetimeFormat: "YYYY-MM-DD/hh_mm_ssZ",
 *         maxBytes: 1000,
 *         maxDuration: "300s",
 *         maxMessages: 1000,
 *     },
 * }, {
 *     dependsOn: [
 *         example,
 *         admin,
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * example = gcp.storage.Bucket("example",
 *     name="example-bucket",
 *     location="US",
 *     uniform_bucket_level_access=True)
 * example_topic = gcp.pubsub.Topic("example", name="example-topic")
 * project = gcp.organizations.get_project()
 * admin = gcp.storage.BucketIAMMember("admin",
 *     bucket=example.name,
 *     role="roles/storage.admin",
 *     member=f"serviceAccount:service-{project.number}@gcp-sa-pubsub.iam.gserviceaccount.com")
 * example_subscription = gcp.pubsub.Subscription("example",
 *     name="example-subscription",
 *     topic=example_topic.id,
 *     cloud_storage_config={
 *         "bucket": example.name,
 *         "filename_prefix": "pre-",
 *         "filename_suffix": "-_33395",
 *         "filename_datetime_format": "YYYY-MM-DD/hh_mm_ssZ",
 *         "max_bytes": 1000,
 *         "max_duration": "300s",
 *         "max_messages": 1000,
 *     },
 *     opts = pulumi.ResourceOptions(depends_on=[
 *             example,
 *             admin,
 *         ]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Gcp.Storage.Bucket("example", new()
 *     {
 *         Name = "example-bucket",
 *         Location = "US",
 *         UniformBucketLevelAccess = true,
 *     });
 *     var exampleTopic = new Gcp.PubSub.Topic("example", new()
 *     {
 *         Name = "example-topic",
 *     });
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var admin = new Gcp.Storage.BucketIAMMember("admin", new()
 *     {
 *         Bucket = example.Name,
 *         Role = "roles/storage.admin",
 *         Member = $"serviceAccount:service-{project.Apply(getProjectResult => getProjectResult.Number)}@gcp-sa-pubsub.iam.gserviceaccount.com",
 *     });
 *     var exampleSubscription = new Gcp.PubSub.Subscription("example", new()
 *     {
 *         Name = "example-subscription",
 *         Topic = exampleTopic.Id,
 *         CloudStorageConfig = new Gcp.PubSub.Inputs.SubscriptionCloudStorageConfigArgs
 *         {
 *             Bucket = example.Name,
 *             FilenamePrefix = "pre-",
 *             FilenameSuffix = "-_33395",
 *             FilenameDatetimeFormat = "YYYY-MM-DD/hh_mm_ssZ",
 *             MaxBytes = 1000,
 *             MaxDuration = "300s",
 *             MaxMessages = 1000,
 *         },
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             example,
 *             admin,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/storage"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := storage.NewBucket(ctx, "example", &storage.BucketArgs{
 * 			Name:                     pulumi.String("example-bucket"),
 * 			Location:                 pulumi.String("US"),
 * 			UniformBucketLevelAccess: pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleTopic, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
 * 			Name: pulumi.String("example-topic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		project, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		admin, err := storage.NewBucketIAMMember(ctx, "admin", &storage.BucketIAMMemberArgs{
 * 			Bucket: example.Name,
 * 			Role:   pulumi.String("roles/storage.admin"),
 * 			Member: pulumi.Sprintf("serviceAccount:service-%[email protected]", project.Number),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = pubsub.NewSubscription(ctx, "example", &pubsub.SubscriptionArgs{
 * 			Name:  pulumi.String("example-subscription"),
 * 			Topic: exampleTopic.ID(),
 * 			CloudStorageConfig: &pubsub.SubscriptionCloudStorageConfigArgs{
 * 				Bucket:                 example.Name,
 * 				FilenamePrefix:         pulumi.String("pre-"),
 * 				FilenameSuffix:         pulumi.String("-_33395"),
 * 				FilenameDatetimeFormat: pulumi.String("YYYY-MM-DD/hh_mm_ssZ"),
 * 				MaxBytes:               pulumi.Int(1000),
 * 				MaxDuration:            pulumi.String("300s"),
 * 				MaxMessages:            pulumi.Int(1000),
 * 			},
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			example,
 * 			admin,
 * 		}))
 * 		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.storage.Bucket;
 * import com.pulumi.gcp.storage.BucketArgs;
 * import com.pulumi.gcp.pubsub.Topic;
 * import com.pulumi.gcp.pubsub.TopicArgs;
 * import com.pulumi.gcp.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.storage.BucketIAMMember;
 * import com.pulumi.gcp.storage.BucketIAMMemberArgs;
 * import com.pulumi.gcp.pubsub.Subscription;
 * import com.pulumi.gcp.pubsub.SubscriptionArgs;
 * import com.pulumi.gcp.pubsub.inputs.SubscriptionCloudStorageConfigArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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) {
 *         var example = new Bucket("example", BucketArgs.builder()
 *             .name("example-bucket")
 *             .location("US")
 *             .uniformBucketLevelAccess(true)
 *             .build());
 *         var exampleTopic = new Topic("exampleTopic", TopicArgs.builder()
 *             .name("example-topic")
 *             .build());
 *         final var project = OrganizationsFunctions.getProject();
 *         var admin = new BucketIAMMember("admin", BucketIAMMemberArgs.builder()
 *             .bucket(example.name())
 *             .role("roles/storage.admin")
 *             .member(String.format("serviceAccount:service-%[email protected]", project.applyValue(getProjectResult -> getProjectResult.number())))
 *             .build());
 *         var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
 *             .name("example-subscription")
 *             .topic(exampleTopic.id())
 *             .cloudStorageConfig(SubscriptionCloudStorageConfigArgs.builder()
 *                 .bucket(example.name())
 *                 .filenamePrefix("pre-")
 *                 .filenameSuffix("-_33395")
 *                 .filenameDatetimeFormat("YYYY-MM-DD/hh_mm_ssZ")
 *                 .maxBytes(1000)
 *                 .maxDuration("300s")
 *                 .maxMessages(1000)
 *                 .build())
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(
 *                     example,
 *                     admin)
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:storage:Bucket
 *     properties:
 *       name: example-bucket
 *       location: US
 *       uniformBucketLevelAccess: true
 *   exampleTopic:
 *     type: gcp:pubsub:Topic
 *     name: example
 *     properties:
 *       name: example-topic
 *   exampleSubscription:
 *     type: gcp:pubsub:Subscription
 *     name: example
 *     properties:
 *       name: example-subscription
 *       topic: ${exampleTopic.id}
 *       cloudStorageConfig:
 *         bucket: ${example.name}
 *         filenamePrefix: pre-
 *         filenameSuffix: -_33395
 *         filenameDatetimeFormat: YYYY-MM-DD/hh_mm_ssZ
 *         maxBytes: 1000
 *         maxDuration: 300s
 *         maxMessages: 1000
 *     options:
 *       dependsOn:
 *         - ${example}
 *         - ${admin}
 *   admin:
 *     type: gcp:storage:BucketIAMMember
 *     properties:
 *       bucket: ${example.name}
 *       role: roles/storage.admin
 *       member: serviceAccount:service-${project.number}@gcp-sa-pubsub.iam.gserviceaccount.com
 * variables:
 *   project:
 *     fn::invoke:
 *       function: gcp:organizations:getProject
 *       arguments: {}
 * ```
 * 
 * ### Pubsub Subscription Push Cloudstorage Avro
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const example = new gcp.storage.Bucket("example", {
 *     name: "example-bucket",
 *     location: "US",
 *     uniformBucketLevelAccess: true,
 * });
 * const exampleTopic = new gcp.pubsub.Topic("example", {name: "example-topic"});
 * const project = gcp.organizations.getProject({});
 * const admin = new gcp.storage.BucketIAMMember("admin", {
 *     bucket: example.name,
 *     role: "roles/storage.admin",
 *     member: project.then(project => `serviceAccount:service-${project.number}@gcp-sa-pubsub.iam.gserviceaccount.com`),
 * });
 * const exampleSubscription = new gcp.pubsub.Subscription("example", {
 *     name: "example-subscription",
 *     topic: exampleTopic.id,
 *     cloudStorageConfig: {
 *         bucket: example.name,
 *         filenamePrefix: "pre-",
 *         filenameSuffix: "-_76044",
 *         filenameDatetimeFormat: "YYYY-MM-DD/hh_mm_ssZ",
 *         maxBytes: 1000,
 *         maxDuration: "300s",
 *         maxMessages: 1000,
 *         avroConfig: {
 *             writeMetadata: true,
 *             useTopicSchema: true,
 *         },
 *     },
 * }, {
 *     dependsOn: [
 *         example,
 *         admin,
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * example = gcp.storage.Bucket("example",
 *     name="example-bucket",
 *     location="US",
 *     uniform_bucket_level_access=True)
 * example_topic = gcp.pubsub.Topic("example", name="example-topic")
 * project = gcp.organizations.get_project()
 * admin = gcp.storage.BucketIAMMember("admin",
 *     bucket=example.name,
 *     role="roles/storage.admin",
 *     member=f"serviceAccount:service-{project.number}@gcp-sa-pubsub.iam.gserviceaccount.com")
 * example_subscription = gcp.pubsub.Subscription("example",
 *     name="example-subscription",
 *     topic=example_topic.id,
 *     cloud_storage_config={
 *         "bucket": example.name,
 *         "filename_prefix": "pre-",
 *         "filename_suffix": "-_76044",
 *         "filename_datetime_format": "YYYY-MM-DD/hh_mm_ssZ",
 *         "max_bytes": 1000,
 *         "max_duration": "300s",
 *         "max_messages": 1000,
 *         "avro_config": {
 *             "write_metadata": True,
 *             "use_topic_schema": True,
 *         },
 *     },
 *     opts = pulumi.ResourceOptions(depends_on=[
 *             example,
 *             admin,
 *         ]))
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Gcp.Storage.Bucket("example", new()
 *     {
 *         Name = "example-bucket",
 *         Location = "US",
 *         UniformBucketLevelAccess = true,
 *     });
 *     var exampleTopic = new Gcp.PubSub.Topic("example", new()
 *     {
 *         Name = "example-topic",
 *     });
 *     var project = Gcp.Organizations.GetProject.Invoke();
 *     var admin = new Gcp.Storage.BucketIAMMember("admin", new()
 *     {
 *         Bucket = example.Name,
 *         Role = "roles/storage.admin",
 *         Member = $"serviceAccount:service-{project.Apply(getProjectResult => getProjectResult.Number)}@gcp-sa-pubsub.iam.gserviceaccount.com",
 *     });
 *     var exampleSubscription = new Gcp.PubSub.Subscription("example", new()
 *     {
 *         Name = "example-subscription",
 *         Topic = exampleTopic.Id,
 *         CloudStorageConfig = new Gcp.PubSub.Inputs.SubscriptionCloudStorageConfigArgs
 *         {
 *             Bucket = example.Name,
 *             FilenamePrefix = "pre-",
 *             FilenameSuffix = "-_76044",
 *             FilenameDatetimeFormat = "YYYY-MM-DD/hh_mm_ssZ",
 *             MaxBytes = 1000,
 *             MaxDuration = "300s",
 *             MaxMessages = 1000,
 *             AvroConfig = new Gcp.PubSub.Inputs.SubscriptionCloudStorageConfigAvroConfigArgs
 *             {
 *                 WriteMetadata = true,
 *                 UseTopicSchema = true,
 *             },
 *         },
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             example,
 *             admin,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/storage"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := storage.NewBucket(ctx, "example", &storage.BucketArgs{
 * 			Name:                     pulumi.String("example-bucket"),
 * 			Location:                 pulumi.String("US"),
 * 			UniformBucketLevelAccess: pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleTopic, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
 * 			Name: pulumi.String("example-topic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		project, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		admin, err := storage.NewBucketIAMMember(ctx, "admin", &storage.BucketIAMMemberArgs{
 * 			Bucket: example.Name,
 * 			Role:   pulumi.String("roles/storage.admin"),
 * 			Member: pulumi.Sprintf("serviceAccount:service-%[email protected]", project.Number),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = pubsub.NewSubscription(ctx, "example", &pubsub.SubscriptionArgs{
 * 			Name:  pulumi.String("example-subscription"),
 * 			Topic: exampleTopic.ID(),
 * 			CloudStorageConfig: &pubsub.SubscriptionCloudStorageConfigArgs{
 * 				Bucket:                 example.Name,
 * 				FilenamePrefix:         pulumi.String("pre-"),
 * 				FilenameSuffix:         pulumi.String("-_76044"),
 * 				FilenameDatetimeFormat: pulumi.String("YYYY-MM-DD/hh_mm_ssZ"),
 * 				MaxBytes:               pulumi.Int(1000),
 * 				MaxDuration:            pulumi.String("300s"),
 * 				MaxMessages:            pulumi.Int(1000),
 * 				AvroConfig: &pubsub.SubscriptionCloudStorageConfigAvroConfigArgs{
 * 					WriteMetadata:  pulumi.Bool(true),
 * 					UseTopicSchema: pulumi.Bool(true),
 * 				},
 * 			},
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			example,
 * 			admin,
 * 		}))
 * 		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.storage.Bucket;
 * import com.pulumi.gcp.storage.BucketArgs;
 * import com.pulumi.gcp.pubsub.Topic;
 * import com.pulumi.gcp.pubsub.TopicArgs;
 * import com.pulumi.gcp.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.gcp.storage.BucketIAMMember;
 * import com.pulumi.gcp.storage.BucketIAMMemberArgs;
 * import com.pulumi.gcp.pubsub.Subscription;
 * import com.pulumi.gcp.pubsub.SubscriptionArgs;
 * import com.pulumi.gcp.pubsub.inputs.SubscriptionCloudStorageConfigArgs;
 * import com.pulumi.gcp.pubsub.inputs.SubscriptionCloudStorageConfigAvroConfigArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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) {
 *         var example = new Bucket("example", BucketArgs.builder()
 *             .name("example-bucket")
 *             .location("US")
 *             .uniformBucketLevelAccess(true)
 *             .build());
 *         var exampleTopic = new Topic("exampleTopic", TopicArgs.builder()
 *             .name("example-topic")
 *             .build());
 *         final var project = OrganizationsFunctions.getProject();
 *         var admin = new BucketIAMMember("admin", BucketIAMMemberArgs.builder()
 *             .bucket(example.name())
 *             .role("roles/storage.admin")
 *             .member(String.format("serviceAccount:service-%[email protected]", project.applyValue(getProjectResult -> getProjectResult.number())))
 *             .build());
 *         var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
 *             .name("example-subscription")
 *             .topic(exampleTopic.id())
 *             .cloudStorageConfig(SubscriptionCloudStorageConfigArgs.builder()
 *                 .bucket(example.name())
 *                 .filenamePrefix("pre-")
 *                 .filenameSuffix("-_76044")
 *                 .filenameDatetimeFormat("YYYY-MM-DD/hh_mm_ssZ")
 *                 .maxBytes(1000)
 *                 .maxDuration("300s")
 *                 .maxMessages(1000)
 *                 .avroConfig(SubscriptionCloudStorageConfigAvroConfigArgs.builder()
 *                     .writeMetadata(true)
 *                     .useTopicSchema(true)
 *                     .build())
 *                 .build())
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(
 *                     example,
 *                     admin)
 *                 .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:storage:Bucket
 *     properties:
 *       name: example-bucket
 *       location: US
 *       uniformBucketLevelAccess: true
 *   exampleTopic:
 *     type: gcp:pubsub:Topic
 *     name: example
 *     properties:
 *       name: example-topic
 *   exampleSubscription:
 *     type: gcp:pubsub:Subscription
 *     name: example
 *     properties:
 *       name: example-subscription
 *       topic: ${exampleTopic.id}
 *       cloudStorageConfig:
 *         bucket: ${example.name}
 *         filenamePrefix: pre-
 *         filenameSuffix: -_76044
 *         filenameDatetimeFormat: YYYY-MM-DD/hh_mm_ssZ
 *         maxBytes: 1000
 *         maxDuration: 300s
 *         maxMessages: 1000
 *         avroConfig:
 *           writeMetadata: true
 *           useTopicSchema: true
 *     options:
 *       dependsOn:
 *         - ${example}
 *         - ${admin}
 *   admin:
 *     type: gcp:storage:BucketIAMMember
 *     properties:
 *       bucket: ${example.name}
 *       role: roles/storage.admin
 *       member: serviceAccount:service-${project.number}@gcp-sa-pubsub.iam.gserviceaccount.com
 * variables:
 *   project:
 *     fn::invoke:
 *       function: gcp:organizations:getProject
 *       arguments: {}
 * ```
 * 
 * ### Pubsub Subscription Push Cloudstorage Service Account
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const example = new gcp.storage.Bucket("example", {
 *     name: "example-bucket",
 *     location: "US",
 *     uniformBucketLevelAccess: true,
 * });
 * const exampleTopic = new gcp.pubsub.Topic("example", {name: "example-topic"});
 * const storageWriteServiceAccount = new gcp.serviceaccount.Account("storage_write_service_account", {
 *     accountId: "example-stw",
 *     displayName: "Storage Write Service Account",
 * });
 * const admin = new gcp.storage.BucketIAMMember("admin", {
 *     bucket: example.name,
 *     role: "roles/storage.admin",
 *     member: pulumi.interpolate`serviceAccount:${storageWriteServiceAccount.email}`,
 * });
 * const exampleSubscription = new gcp.pubsub.Subscription("example", {
 *     name: "example-subscription",
 *     topic: exampleTopic.id,
 *     cloudStorageConfig: {
 *         bucket: example.name,
 *         filenamePrefix: "pre-",
 *         filenameSuffix: "-_69391",
 *         filenameDatetimeFormat: "YYYY-MM-DD/hh_mm_ssZ",
 *         maxBytes: 1000,
 *         maxDuration: "300s",
 *         serviceAccountEmail: storageWriteServiceAccount.email,
 *     },
 * }, {
 *     dependsOn: [
 *         storageWriteServiceAccount,
 *         example,
 *         admin,
 *     ],
 * });
 * const project = gcp.organizations.getProject({});
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * example = gcp.storage.Bucket("example",
 *     name="example-bucket",
 *     location="US",
 *     uniform_bucket_level_access=True)
 * example_topic = gcp.pubsub.Topic("example", name="example-topic")
 * storage_write_service_account = gcp.serviceaccount.Account("storage_write_service_account",
 *     account_id="example-stw",
 *     display_name="Storage Write Service Account")
 * admin = gcp.storage.BucketIAMMember("admin",
 *     bucket=example.name,
 *     role="roles/storage.admin",
 *     member=storage_write_service_account.email.apply(lambda email: f"serviceAccount:{email}"))
 * example_subscription = gcp.pubsub.Subscription("example",
 *     name="example-subscription",
 *     topic=example_topic.id,
 *     cloud_storage_config={
 *         "bucket": example.name,
 *         "filename_prefix": "pre-",
 *         "filename_suffix": "-_69391",
 *         "filename_datetime_format": "YYYY-MM-DD/hh_mm_ssZ",
 *         "max_bytes": 1000,
 *         "max_duration": "300s",
 *         "service_account_email": storage_write_service_account.email,
 *     },
 *     opts = pulumi.ResourceOptions(depends_on=[
 *             storage_write_service_account,
 *             example,
 *             admin,
 *         ]))
 * project = gcp.organizations.get_project()
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Gcp.Storage.Bucket("example", new()
 *     {
 *         Name = "example-bucket",
 *         Location = "US",
 *         UniformBucketLevelAccess = true,
 *     });
 *     var exampleTopic = new Gcp.PubSub.Topic("example", new()
 *     {
 *         Name = "example-topic",
 *     });
 *     var storageWriteServiceAccount = new Gcp.ServiceAccount.Account("storage_write_service_account", new()
 *     {
 *         AccountId = "example-stw",
 *         DisplayName = "Storage Write Service Account",
 *     });
 *     var admin = new Gcp.Storage.BucketIAMMember("admin", new()
 *     {
 *         Bucket = example.Name,
 *         Role = "roles/storage.admin",
 *         Member = storageWriteServiceAccount.Email.Apply(email => $"serviceAccount:{email}"),
 *     });
 *     var exampleSubscription = new Gcp.PubSub.Subscription("example", new()
 *     {
 *         Name = "example-subscription",
 *         Topic = exampleTopic.Id,
 *         CloudStorageConfig = new Gcp.PubSub.Inputs.SubscriptionCloudStorageConfigArgs
 *         {
 *             Bucket = example.Name,
 *             FilenamePrefix = "pre-",
 *             FilenameSuffix = "-_69391",
 *             FilenameDatetimeFormat = "YYYY-MM-DD/hh_mm_ssZ",
 *             MaxBytes = 1000,
 *             MaxDuration = "300s",
 *             ServiceAccountEmail = storageWriteServiceAccount.Email,
 *         },
 *     }, new CustomResourceOptions
 *     {
 *         DependsOn =
 *         {
 *             storageWriteServiceAccount,
 *             example,
 *             admin,
 *         },
 *     });
 *     var project = Gcp.Organizations.GetProject.Invoke();
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/serviceaccount"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/storage"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := storage.NewBucket(ctx, "example", &storage.BucketArgs{
 * 			Name:                     pulumi.String("example-bucket"),
 * 			Location:                 pulumi.String("US"),
 * 			UniformBucketLevelAccess: pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleTopic, err := pubsub.NewTopic(ctx, "example", &pubsub.TopicArgs{
 * 			Name: pulumi.String("example-topic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		storageWriteServiceAccount, err := serviceaccount.NewAccount(ctx, "storage_write_service_account", &serviceaccount.AccountArgs{
 * 			AccountId:   pulumi.String("example-stw"),
 * 			DisplayName: pulumi.String("Storage Write Service Account"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		admin, err := storage.NewBucketIAMMember(ctx, "admin", &storage.BucketIAMMemberArgs{
 * 			Bucket: example.Name,
 * 			Role:   pulumi.String("roles/storage.admin"),
 * 			Member: storageWriteServiceAccount.Email.ApplyT(func(email string) (string, error) {
 * 				return fmt.Sprintf("serviceAccount:%v", email), nil
 * 			}).(pulumi.StringOutput),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = pubsub.NewSubscription(ctx, "example", &pubsub.SubscriptionArgs{
 * 			Name:  pulumi.String("example-subscription"),
 * 			Topic: exampleTopic.ID(),
 * 			CloudStorageConfig: &pubsub.SubscriptionCloudStorageConfigArgs{
 * 				Bucket:                 example.Name,
 * 				FilenamePrefix:         pulumi.String("pre-"),
 * 				FilenameSuffix:         pulumi.String("-_69391"),
 * 				FilenameDatetimeFormat: pulumi.String("YYYY-MM-DD/hh_mm_ssZ"),
 * 				MaxBytes:               pulumi.Int(1000),
 * 				MaxDuration:            pulumi.String("300s"),
 * 				ServiceAccountEmail:    storageWriteServiceAccount.Email,
 * 			},
 * 		}, pulumi.DependsOn([]pulumi.Resource{
 * 			storageWriteServiceAccount,
 * 			example,
 * 			admin,
 * 		}))
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, 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.storage.Bucket;
 * import com.pulumi.gcp.storage.BucketArgs;
 * import com.pulumi.gcp.pubsub.Topic;
 * import com.pulumi.gcp.pubsub.TopicArgs;
 * import com.pulumi.gcp.serviceaccount.Account;
 * import com.pulumi.gcp.serviceaccount.AccountArgs;
 * import com.pulumi.gcp.storage.BucketIAMMember;
 * import com.pulumi.gcp.storage.BucketIAMMemberArgs;
 * import com.pulumi.gcp.pubsub.Subscription;
 * import com.pulumi.gcp.pubsub.SubscriptionArgs;
 * import com.pulumi.gcp.pubsub.inputs.SubscriptionCloudStorageConfigArgs;
 * import com.pulumi.gcp.organizations.OrganizationsFunctions;
 * import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
 * import com.pulumi.resources.CustomResourceOptions;
 * 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) {
 *         var example = new Bucket("example", BucketArgs.builder()
 *             .name("example-bucket")
 *             .location("US")
 *             .uniformBucketLevelAccess(true)
 *             .build());
 *         var exampleTopic = new Topic("exampleTopic", TopicArgs.builder()
 *             .name("example-topic")
 *             .build());
 *         var storageWriteServiceAccount = new Account("storageWriteServiceAccount", AccountArgs.builder()
 *             .accountId("example-stw")
 *             .displayName("Storage Write Service Account")
 *             .build());
 *         var admin = new BucketIAMMember("admin", BucketIAMMemberArgs.builder()
 *             .bucket(example.name())
 *             .role("roles/storage.admin")
 *             .member(storageWriteServiceAccount.email().applyValue(email -> String.format("serviceAccount:%s", email)))
 *             .build());
 *         var exampleSubscription = new Subscription("exampleSubscription", SubscriptionArgs.builder()
 *             .name("example-subscription")
 *             .topic(exampleTopic.id())
 *             .cloudStorageConfig(SubscriptionCloudStorageConfigArgs.builder()
 *                 .bucket(example.name())
 *                 .filenamePrefix("pre-")
 *                 .filenameSuffix("-_69391")
 *                 .filenameDatetimeFormat("YYYY-MM-DD/hh_mm_ssZ")
 *                 .maxBytes(1000)
 *                 .maxDuration("300s")
 *                 .serviceAccountEmail(storageWriteServiceAccount.email())
 *                 .build())
 *             .build(), CustomResourceOptions.builder()
 *                 .dependsOn(
 *                     storageWriteServiceAccount,
 *                     example,
 *                     admin)
 *                 .build());
 *         final var project = OrganizationsFunctions.getProject();
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: gcp:storage:Bucket
 *     properties:
 *       name: example-bucket
 *       location: US
 *       uniformBucketLevelAccess: true
 *   exampleTopic:
 *     type: gcp:pubsub:Topic
 *     name: example
 *     properties:
 *       name: example-topic
 *   exampleSubscription:
 *     type: gcp:pubsub:Subscription
 *     name: example
 *     properties:
 *       name: example-subscription
 *       topic: ${exampleTopic.id}
 *       cloudStorageConfig:
 *         bucket: ${example.name}
 *         filenamePrefix: pre-
 *         filenameSuffix: -_69391
 *         filenameDatetimeFormat: YYYY-MM-DD/hh_mm_ssZ
 *         maxBytes: 1000
 *         maxDuration: 300s
 *         serviceAccountEmail: ${storageWriteServiceAccount.email}
 *     options:
 *       dependsOn:
 *         - ${storageWriteServiceAccount}
 *         - ${example}
 *         - ${admin}
 *   storageWriteServiceAccount:
 *     type: gcp:serviceaccount:Account
 *     name: storage_write_service_account
 *     properties:
 *       accountId: example-stw
 *       displayName: Storage Write Service Account
 *   admin:
 *     type: gcp:storage:BucketIAMMember
 *     properties:
 *       bucket: ${example.name}
 *       role: roles/storage.admin
 *       member: serviceAccount:${storageWriteServiceAccount.email}
 * variables:
 *   project:
 *     fn::invoke:
 *       function: gcp:organizations:getProject
 *       arguments: {}
 * ```
 * 
 * ## Import
 * Subscription can be imported using any of these accepted formats:
 * * `projects/{{project}}/subscriptions/{{name}}`
 * * `{{project}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, Subscription can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:pubsub/subscription:Subscription default projects/{{project}}/subscriptions/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:pubsub/subscription:Subscription default {{project}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:pubsub/subscription:Subscription default {{name}}
 * ```
 * @property ackDeadlineSeconds This value is the maximum time after a subscriber receives a message
 * before the subscriber should acknowledge the message. After message
 * delivery but before the ack deadline expires and before the message is
 * acknowledged, it is an outstanding message and will not be delivered
 * again during that time (on a best-effort basis).
 * For pull subscriptions, this value is used as the initial value for
 * the ack deadline. To override this value for a given message, call
 * subscriptions.modifyAckDeadline with the corresponding ackId if using
 * pull. The minimum custom deadline you can specify is 10 seconds. The
 * maximum custom deadline you can specify is 600 seconds (10 minutes).
 * If this parameter is 0, a default value of 10 seconds is used.
 * For push delivery, this value is also used to set the request timeout
 * for the call to the push endpoint.
 * If the subscriber never acknowledges the message, the Pub/Sub system
 * will eventually redeliver the message.
 * @property bigqueryConfig If delivery to BigQuery is used with this subscription, this field is used to configure it.
 * Either pushConfig, bigQueryConfig or cloudStorageConfig can be set, but not combined.
 * If all three are empty, then the subscriber will pull and ack messages using API methods.
 * Structure is documented below.
 * @property cloudStorageConfig If delivery to Cloud Storage is used with this subscription, this field is used to configure it.
 * Either pushConfig, bigQueryConfig or cloudStorageConfig can be set, but not combined.
 * If all three are empty, then the subscriber will pull and ack messages using API methods.
 * Structure is documented below.
 * @property deadLetterPolicy A policy that specifies the conditions for dead lettering messages in
 * this subscription. If dead_letter_policy is not set, dead lettering
 * is disabled.
 * The Cloud Pub/Sub service account associated with this subscription's
 * parent project (i.e.,
 * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
 * permission to Acknowledge() messages on this subscription.
 * Structure is documented below.
 * @property enableExactlyOnceDelivery If `true`, Pub/Sub provides the following guarantees for the delivery
 * of a message with a given value of messageId on this Subscriptions':
 * - The message sent to a subscriber is guaranteed not to be resent before the message's acknowledgement deadline expires.
 * - An acknowledged message will not be resent to a subscriber.
 * Note that subscribers may still receive multiple copies of a message when `enable_exactly_once_delivery`
 * is true if the message was published multiple times by a publisher client. These copies are considered distinct by Pub/Sub and have distinct messageId values
 * @property enableMessageOrdering If `true`, messages published with the same orderingKey in PubsubMessage will be delivered to
 * the subscribers in the order in which they are received by the Pub/Sub system. Otherwise, they
 * may be delivered in any order.
 * @property expirationPolicy A policy that specifies the conditions for this subscription's expiration.
 * A subscription is considered active as long as any connected subscriber
 * is successfully consuming messages from the subscription or is issuing
 * operations on the subscription. If expirationPolicy is not set, a default
 * policy with ttl of 31 days will be used.  If it is set but ttl is "", the
 * resource never expires.  The minimum allowed value for expirationPolicy.ttl
 * is 1 day.
 * Structure is documented below.
 * @property filter The subscription only delivers the messages that match the filter.
 * Pub/Sub automatically acknowledges the messages that don't match the filter. You can filter messages
 * by their attributes. The maximum length of a filter is 256 bytes. After creating the subscription,
 * you can't modify the filter.
 * @property labels A set of key/value label pairs to assign to this Subscription.
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
 * Please refer to the field `effective_labels` for all of the labels present on the resource.
 * @property messageRetentionDuration How long to retain unacknowledged messages in the subscription's
 * backlog, from the moment a message is published. If
 * retain_acked_messages is true, then this also configures the retention
 * of acknowledged messages, and thus configures how far back in time a
 * subscriptions.seek can be done. Defaults to 7 days. Cannot be more
 * than 31 days (`"2678400s"`) or less than 10 minutes (`"600s"`).
 * A duration in seconds with up to nine fractional digits, terminated
 * by 's'. Example: `"600.5s"`.
 * @property name Name of the subscription.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property pushConfig If push delivery is used with this subscription, this field is used to
 * configure it. An empty pushConfig signifies that the subscriber will
 * pull and ack messages using API methods.
 * Structure is documented below.
 * @property retainAckedMessages Indicates whether to retain acknowledged messages. If `true`, then
 * messages are not expunged from the subscription's backlog, even if
 * they are acknowledged, until they fall out of the
 * messageRetentionDuration window.
 * @property retryPolicy A policy that specifies how Pub/Sub retries message delivery for this subscription.
 * If not set, the default retry policy is applied. This generally implies that messages will be retried as soon as possible for healthy subscribers.
 * RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded events for a given message
 * Structure is documented below.
 * @property topic A reference to a Topic resource, of the form projects/{project}/topics/{{name}}
 * (as in the id property of a google_pubsub_topic), or just a topic name if
 * the topic is in the same project as the subscription.
 * - - -
 */
public data class SubscriptionArgs(
    public val ackDeadlineSeconds: Output? = null,
    public val bigqueryConfig: Output? = null,
    public val cloudStorageConfig: Output? = null,
    public val deadLetterPolicy: Output? = null,
    public val enableExactlyOnceDelivery: Output? = null,
    public val enableMessageOrdering: Output? = null,
    public val expirationPolicy: Output? = null,
    public val filter: Output? = null,
    public val labels: Output>? = null,
    public val messageRetentionDuration: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val pushConfig: Output? = null,
    public val retainAckedMessages: Output? = null,
    public val retryPolicy: Output? = null,
    public val topic: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.pubsub.SubscriptionArgs =
        com.pulumi.gcp.pubsub.SubscriptionArgs.builder()
            .ackDeadlineSeconds(ackDeadlineSeconds?.applyValue({ args0 -> args0 }))
            .bigqueryConfig(bigqueryConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .cloudStorageConfig(
                cloudStorageConfig?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .deadLetterPolicy(deadLetterPolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .enableExactlyOnceDelivery(enableExactlyOnceDelivery?.applyValue({ args0 -> args0 }))
            .enableMessageOrdering(enableMessageOrdering?.applyValue({ args0 -> args0 }))
            .expirationPolicy(expirationPolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .filter(filter?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .messageRetentionDuration(messageRetentionDuration?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .pushConfig(pushConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .retainAckedMessages(retainAckedMessages?.applyValue({ args0 -> args0 }))
            .retryPolicy(retryPolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .topic(topic?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [SubscriptionArgs].
 */
@PulumiTagMarker
public class SubscriptionArgsBuilder internal constructor() {
    private var ackDeadlineSeconds: Output? = null

    private var bigqueryConfig: Output? = null

    private var cloudStorageConfig: Output? = null

    private var deadLetterPolicy: Output? = null

    private var enableExactlyOnceDelivery: Output? = null

    private var enableMessageOrdering: Output? = null

    private var expirationPolicy: Output? = null

    private var filter: Output? = null

    private var labels: Output>? = null

    private var messageRetentionDuration: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var pushConfig: Output? = null

    private var retainAckedMessages: Output? = null

    private var retryPolicy: Output? = null

    private var topic: Output? = null

    /**
     * @param value This value is the maximum time after a subscriber receives a message
     * before the subscriber should acknowledge the message. After message
     * delivery but before the ack deadline expires and before the message is
     * acknowledged, it is an outstanding message and will not be delivered
     * again during that time (on a best-effort basis).
     * For pull subscriptions, this value is used as the initial value for
     * the ack deadline. To override this value for a given message, call
     * subscriptions.modifyAckDeadline with the corresponding ackId if using
     * pull. The minimum custom deadline you can specify is 10 seconds. The
     * maximum custom deadline you can specify is 600 seconds (10 minutes).
     * If this parameter is 0, a default value of 10 seconds is used.
     * For push delivery, this value is also used to set the request timeout
     * for the call to the push endpoint.
     * If the subscriber never acknowledges the message, the Pub/Sub system
     * will eventually redeliver the message.
     */
    @JvmName("haxvgjqbyaemowaf")
    public suspend fun ackDeadlineSeconds(`value`: Output) {
        this.ackDeadlineSeconds = value
    }

    /**
     * @param value If delivery to BigQuery is used with this subscription, this field is used to configure it.
     * Either pushConfig, bigQueryConfig or cloudStorageConfig can be set, but not combined.
     * If all three are empty, then the subscriber will pull and ack messages using API methods.
     * Structure is documented below.
     */
    @JvmName("thobnsvxaurphqkt")
    public suspend fun bigqueryConfig(`value`: Output) {
        this.bigqueryConfig = value
    }

    /**
     * @param value If delivery to Cloud Storage is used with this subscription, this field is used to configure it.
     * Either pushConfig, bigQueryConfig or cloudStorageConfig can be set, but not combined.
     * If all three are empty, then the subscriber will pull and ack messages using API methods.
     * Structure is documented below.
     */
    @JvmName("bqprxfjpjpcbetaf")
    public suspend fun cloudStorageConfig(`value`: Output) {
        this.cloudStorageConfig = value
    }

    /**
     * @param value A policy that specifies the conditions for dead lettering messages in
     * this subscription. If dead_letter_policy is not set, dead lettering
     * is disabled.
     * The Cloud Pub/Sub service account associated with this subscription's
     * parent project (i.e.,
     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
     * permission to Acknowledge() messages on this subscription.
     * Structure is documented below.
     */
    @JvmName("xbsjbgowsstygauc")
    public suspend fun deadLetterPolicy(`value`: Output) {
        this.deadLetterPolicy = value
    }

    /**
     * @param value If `true`, Pub/Sub provides the following guarantees for the delivery
     * of a message with a given value of messageId on this Subscriptions':
     * - The message sent to a subscriber is guaranteed not to be resent before the message's acknowledgement deadline expires.
     * - An acknowledged message will not be resent to a subscriber.
     * Note that subscribers may still receive multiple copies of a message when `enable_exactly_once_delivery`
     * is true if the message was published multiple times by a publisher client. These copies are considered distinct by Pub/Sub and have distinct messageId values
     */
    @JvmName("xelohrxatehlxtst")
    public suspend fun enableExactlyOnceDelivery(`value`: Output) {
        this.enableExactlyOnceDelivery = value
    }

    /**
     * @param value If `true`, messages published with the same orderingKey in PubsubMessage will be delivered to
     * the subscribers in the order in which they are received by the Pub/Sub system. Otherwise, they
     * may be delivered in any order.
     */
    @JvmName("kbvuedsypgatsvwl")
    public suspend fun enableMessageOrdering(`value`: Output) {
        this.enableMessageOrdering = value
    }

    /**
     * @param value A policy that specifies the conditions for this subscription's expiration.
     * A subscription is considered active as long as any connected subscriber
     * is successfully consuming messages from the subscription or is issuing
     * operations on the subscription. If expirationPolicy is not set, a default
     * policy with ttl of 31 days will be used.  If it is set but ttl is "", the
     * resource never expires.  The minimum allowed value for expirationPolicy.ttl
     * is 1 day.
     * Structure is documented below.
     */
    @JvmName("vjdifiaancmjobyu")
    public suspend fun expirationPolicy(`value`: Output) {
        this.expirationPolicy = value
    }

    /**
     * @param value The subscription only delivers the messages that match the filter.
     * Pub/Sub automatically acknowledges the messages that don't match the filter. You can filter messages
     * by their attributes. The maximum length of a filter is 256 bytes. After creating the subscription,
     * you can't modify the filter.
     */
    @JvmName("fopqiqhprpspvkob")
    public suspend fun filter(`value`: Output) {
        this.filter = value
    }

    /**
     * @param value A set of key/value label pairs to assign to this Subscription.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("faysncayqwbhoolo")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value How long to retain unacknowledged messages in the subscription's
     * backlog, from the moment a message is published. If
     * retain_acked_messages is true, then this also configures the retention
     * of acknowledged messages, and thus configures how far back in time a
     * subscriptions.seek can be done. Defaults to 7 days. Cannot be more
     * than 31 days (`"2678400s"`) or less than 10 minutes (`"600s"`).
     * A duration in seconds with up to nine fractional digits, terminated
     * by 's'. Example: `"600.5s"`.
     */
    @JvmName("bvhekfwsisofhebr")
    public suspend fun messageRetentionDuration(`value`: Output) {
        this.messageRetentionDuration = value
    }

    /**
     * @param value Name of the subscription.
     */
    @JvmName("vhqksnpkiaekaepy")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("qohrykqttarjcvpt")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value If push delivery is used with this subscription, this field is used to
     * configure it. An empty pushConfig signifies that the subscriber will
     * pull and ack messages using API methods.
     * Structure is documented below.
     */
    @JvmName("eheeohumgriwyrpm")
    public suspend fun pushConfig(`value`: Output) {
        this.pushConfig = value
    }

    /**
     * @param value Indicates whether to retain acknowledged messages. If `true`, then
     * messages are not expunged from the subscription's backlog, even if
     * they are acknowledged, until they fall out of the
     * messageRetentionDuration window.
     */
    @JvmName("xyenxhxcujbrlyyi")
    public suspend fun retainAckedMessages(`value`: Output) {
        this.retainAckedMessages = value
    }

    /**
     * @param value A policy that specifies how Pub/Sub retries message delivery for this subscription.
     * If not set, the default retry policy is applied. This generally implies that messages will be retried as soon as possible for healthy subscribers.
     * RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded events for a given message
     * Structure is documented below.
     */
    @JvmName("qosjmnlaojwcbtry")
    public suspend fun retryPolicy(`value`: Output) {
        this.retryPolicy = value
    }

    /**
     * @param value A reference to a Topic resource, of the form projects/{project}/topics/{{name}}
     * (as in the id property of a google_pubsub_topic), or just a topic name if
     * the topic is in the same project as the subscription.
     * - - -
     */
    @JvmName("dxgluoyratqifprj")
    public suspend fun topic(`value`: Output) {
        this.topic = value
    }

    /**
     * @param value This value is the maximum time after a subscriber receives a message
     * before the subscriber should acknowledge the message. After message
     * delivery but before the ack deadline expires and before the message is
     * acknowledged, it is an outstanding message and will not be delivered
     * again during that time (on a best-effort basis).
     * For pull subscriptions, this value is used as the initial value for
     * the ack deadline. To override this value for a given message, call
     * subscriptions.modifyAckDeadline with the corresponding ackId if using
     * pull. The minimum custom deadline you can specify is 10 seconds. The
     * maximum custom deadline you can specify is 600 seconds (10 minutes).
     * If this parameter is 0, a default value of 10 seconds is used.
     * For push delivery, this value is also used to set the request timeout
     * for the call to the push endpoint.
     * If the subscriber never acknowledges the message, the Pub/Sub system
     * will eventually redeliver the message.
     */
    @JvmName("wumeipyerbrxakoa")
    public suspend fun ackDeadlineSeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ackDeadlineSeconds = mapped
    }

    /**
     * @param value If delivery to BigQuery is used with this subscription, this field is used to configure it.
     * Either pushConfig, bigQueryConfig or cloudStorageConfig can be set, but not combined.
     * If all three are empty, then the subscriber will pull and ack messages using API methods.
     * Structure is documented below.
     */
    @JvmName("gymydngorvxqakta")
    public suspend fun bigqueryConfig(`value`: SubscriptionBigqueryConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bigqueryConfig = mapped
    }

    /**
     * @param argument If delivery to BigQuery is used with this subscription, this field is used to configure it.
     * Either pushConfig, bigQueryConfig or cloudStorageConfig can be set, but not combined.
     * If all three are empty, then the subscriber will pull and ack messages using API methods.
     * Structure is documented below.
     */
    @JvmName("anusvppapphupvvh")
    public suspend fun bigqueryConfig(argument: suspend SubscriptionBigqueryConfigArgsBuilder.() -> Unit) {
        val toBeMapped = SubscriptionBigqueryConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.bigqueryConfig = mapped
    }

    /**
     * @param value If delivery to Cloud Storage is used with this subscription, this field is used to configure it.
     * Either pushConfig, bigQueryConfig or cloudStorageConfig can be set, but not combined.
     * If all three are empty, then the subscriber will pull and ack messages using API methods.
     * Structure is documented below.
     */
    @JvmName("ahrwpmvwqqrafbyq")
    public suspend fun cloudStorageConfig(`value`: SubscriptionCloudStorageConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cloudStorageConfig = mapped
    }

    /**
     * @param argument If delivery to Cloud Storage is used with this subscription, this field is used to configure it.
     * Either pushConfig, bigQueryConfig or cloudStorageConfig can be set, but not combined.
     * If all three are empty, then the subscriber will pull and ack messages using API methods.
     * Structure is documented below.
     */
    @JvmName("wcpyhylywahvpevx")
    public suspend fun cloudStorageConfig(argument: suspend SubscriptionCloudStorageConfigArgsBuilder.() -> Unit) {
        val toBeMapped = SubscriptionCloudStorageConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.cloudStorageConfig = mapped
    }

    /**
     * @param value A policy that specifies the conditions for dead lettering messages in
     * this subscription. If dead_letter_policy is not set, dead lettering
     * is disabled.
     * The Cloud Pub/Sub service account associated with this subscription's
     * parent project (i.e.,
     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
     * permission to Acknowledge() messages on this subscription.
     * Structure is documented below.
     */
    @JvmName("awocvixneblroogg")
    public suspend fun deadLetterPolicy(`value`: SubscriptionDeadLetterPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deadLetterPolicy = mapped
    }

    /**
     * @param argument A policy that specifies the conditions for dead lettering messages in
     * this subscription. If dead_letter_policy is not set, dead lettering
     * is disabled.
     * The Cloud Pub/Sub service account associated with this subscription's
     * parent project (i.e.,
     * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have
     * permission to Acknowledge() messages on this subscription.
     * Structure is documented below.
     */
    @JvmName("dwgmvoaatcqormgi")
    public suspend fun deadLetterPolicy(argument: suspend SubscriptionDeadLetterPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = SubscriptionDeadLetterPolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.deadLetterPolicy = mapped
    }

    /**
     * @param value If `true`, Pub/Sub provides the following guarantees for the delivery
     * of a message with a given value of messageId on this Subscriptions':
     * - The message sent to a subscriber is guaranteed not to be resent before the message's acknowledgement deadline expires.
     * - An acknowledged message will not be resent to a subscriber.
     * Note that subscribers may still receive multiple copies of a message when `enable_exactly_once_delivery`
     * is true if the message was published multiple times by a publisher client. These copies are considered distinct by Pub/Sub and have distinct messageId values
     */
    @JvmName("tqfcemtssbyydoea")
    public suspend fun enableExactlyOnceDelivery(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enableExactlyOnceDelivery = mapped
    }

    /**
     * @param value If `true`, messages published with the same orderingKey in PubsubMessage will be delivered to
     * the subscribers in the order in which they are received by the Pub/Sub system. Otherwise, they
     * may be delivered in any order.
     */
    @JvmName("mcpnxnbdvnoxnevg")
    public suspend fun enableMessageOrdering(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enableMessageOrdering = mapped
    }

    /**
     * @param value A policy that specifies the conditions for this subscription's expiration.
     * A subscription is considered active as long as any connected subscriber
     * is successfully consuming messages from the subscription or is issuing
     * operations on the subscription. If expirationPolicy is not set, a default
     * policy with ttl of 31 days will be used.  If it is set but ttl is "", the
     * resource never expires.  The minimum allowed value for expirationPolicy.ttl
     * is 1 day.
     * Structure is documented below.
     */
    @JvmName("ppnrdriumkgdured")
    public suspend fun expirationPolicy(`value`: SubscriptionExpirationPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.expirationPolicy = mapped
    }

    /**
     * @param argument A policy that specifies the conditions for this subscription's expiration.
     * A subscription is considered active as long as any connected subscriber
     * is successfully consuming messages from the subscription or is issuing
     * operations on the subscription. If expirationPolicy is not set, a default
     * policy with ttl of 31 days will be used.  If it is set but ttl is "", the
     * resource never expires.  The minimum allowed value for expirationPolicy.ttl
     * is 1 day.
     * Structure is documented below.
     */
    @JvmName("ixthoxyvdghdadle")
    public suspend fun expirationPolicy(argument: suspend SubscriptionExpirationPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = SubscriptionExpirationPolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.expirationPolicy = mapped
    }

    /**
     * @param value The subscription only delivers the messages that match the filter.
     * Pub/Sub automatically acknowledges the messages that don't match the filter. You can filter messages
     * by their attributes. The maximum length of a filter is 256 bytes. After creating the subscription,
     * you can't modify the filter.
     */
    @JvmName("reyidbmsfidjqrtq")
    public suspend fun filter(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.filter = mapped
    }

    /**
     * @param value A set of key/value label pairs to assign to this Subscription.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("mlvmumjhgwtkluuo")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values A set of key/value label pairs to assign to this Subscription.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("gnnfagcksxxpeora")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value How long to retain unacknowledged messages in the subscription's
     * backlog, from the moment a message is published. If
     * retain_acked_messages is true, then this also configures the retention
     * of acknowledged messages, and thus configures how far back in time a
     * subscriptions.seek can be done. Defaults to 7 days. Cannot be more
     * than 31 days (`"2678400s"`) or less than 10 minutes (`"600s"`).
     * A duration in seconds with up to nine fractional digits, terminated
     * by 's'. Example: `"600.5s"`.
     */
    @JvmName("quruiqmujknrxwcu")
    public suspend fun messageRetentionDuration(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.messageRetentionDuration = mapped
    }

    /**
     * @param value Name of the subscription.
     */
    @JvmName("sbetawuuujgfvaxw")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("hexvydsfvqpmgoyn")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value If push delivery is used with this subscription, this field is used to
     * configure it. An empty pushConfig signifies that the subscriber will
     * pull and ack messages using API methods.
     * Structure is documented below.
     */
    @JvmName("futurxneepayddwh")
    public suspend fun pushConfig(`value`: SubscriptionPushConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.pushConfig = mapped
    }

    /**
     * @param argument If push delivery is used with this subscription, this field is used to
     * configure it. An empty pushConfig signifies that the subscriber will
     * pull and ack messages using API methods.
     * Structure is documented below.
     */
    @JvmName("acowlholdogdgetd")
    public suspend fun pushConfig(argument: suspend SubscriptionPushConfigArgsBuilder.() -> Unit) {
        val toBeMapped = SubscriptionPushConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.pushConfig = mapped
    }

    /**
     * @param value Indicates whether to retain acknowledged messages. If `true`, then
     * messages are not expunged from the subscription's backlog, even if
     * they are acknowledged, until they fall out of the
     * messageRetentionDuration window.
     */
    @JvmName("rnjiqcntwdadfxsm")
    public suspend fun retainAckedMessages(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retainAckedMessages = mapped
    }

    /**
     * @param value A policy that specifies how Pub/Sub retries message delivery for this subscription.
     * If not set, the default retry policy is applied. This generally implies that messages will be retried as soon as possible for healthy subscribers.
     * RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded events for a given message
     * Structure is documented below.
     */
    @JvmName("xbpekbyhtowaywsc")
    public suspend fun retryPolicy(`value`: SubscriptionRetryPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retryPolicy = mapped
    }

    /**
     * @param argument A policy that specifies how Pub/Sub retries message delivery for this subscription.
     * If not set, the default retry policy is applied. This generally implies that messages will be retried as soon as possible for healthy subscribers.
     * RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded events for a given message
     * Structure is documented below.
     */
    @JvmName("dkeueqkxnhpusqrj")
    public suspend fun retryPolicy(argument: suspend SubscriptionRetryPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = SubscriptionRetryPolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.retryPolicy = mapped
    }

    /**
     * @param value A reference to a Topic resource, of the form projects/{project}/topics/{{name}}
     * (as in the id property of a google_pubsub_topic), or just a topic name if
     * the topic is in the same project as the subscription.
     * - - -
     */
    @JvmName("fjgmkoaslcpyaovg")
    public suspend fun topic(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.topic = mapped
    }

    internal fun build(): SubscriptionArgs = SubscriptionArgs(
        ackDeadlineSeconds = ackDeadlineSeconds,
        bigqueryConfig = bigqueryConfig,
        cloudStorageConfig = cloudStorageConfig,
        deadLetterPolicy = deadLetterPolicy,
        enableExactlyOnceDelivery = enableExactlyOnceDelivery,
        enableMessageOrdering = enableMessageOrdering,
        expirationPolicy = expirationPolicy,
        filter = filter,
        labels = labels,
        messageRetentionDuration = messageRetentionDuration,
        name = name,
        project = project,
        pushConfig = pushConfig,
        retainAckedMessages = retainAckedMessages,
        retryPolicy = retryPolicy,
        topic = topic,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy