Skip to content

Commit 6f271db

Browse files
feat: add BigQuery configuration for subscriptions (#1133)
* feat: add BigQuery configuration for subscriptions PiperOrigin-RevId: 449031535 Source-Link: googleapis/googleapis@feec34d Source-Link: https://github.com/googleapis/googleapis-gen/commit/89664e9708c19d532c63f7a16fd79cb631d87aa1 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODk2NjRlOTcwOGMxOWQ1MzJjNjNmN2ExNmZkNzljYjYzMWQ4N2FhMSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent b5b004b commit 6f271db

File tree

10 files changed

+2591
-300
lines changed

10 files changed

+2591
-300
lines changed

google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ public SubscriberStub getStub() {
235235
* messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be
236236
* `_deleted-topic_` if the topic has been deleted.
237237
* @param pushConfig If push delivery is used with this subscription, this field is used to
238-
* configure it. An empty `pushConfig` signifies that the subscriber will pull and ack
239-
* messages using API methods.
238+
* configure it. Either `pushConfig` or `bigQueryConfig` can be set, but not both. If both are
239+
* empty, then the subscriber will pull and ack messages using API methods.
240240
* @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits
241241
* for the subscriber to acknowledge receipt before resending the message. In the interval
242242
* after the message is delivered and before it is acknowledged, it is considered to be
@@ -303,8 +303,8 @@ public final Subscription createSubscription(
303303
* messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be
304304
* `_deleted-topic_` if the topic has been deleted.
305305
* @param pushConfig If push delivery is used with this subscription, this field is used to
306-
* configure it. An empty `pushConfig` signifies that the subscriber will pull and ack
307-
* messages using API methods.
306+
* configure it. Either `pushConfig` or `bigQueryConfig` can be set, but not both. If both are
307+
* empty, then the subscriber will pull and ack messages using API methods.
308308
* @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits
309309
* for the subscriber to acknowledge receipt before resending the message. In the interval
310310
* after the message is delivered and before it is acknowledged, it is considered to be
@@ -371,8 +371,8 @@ public final Subscription createSubscription(
371371
* messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be
372372
* `_deleted-topic_` if the topic has been deleted.
373373
* @param pushConfig If push delivery is used with this subscription, this field is used to
374-
* configure it. An empty `pushConfig` signifies that the subscriber will pull and ack
375-
* messages using API methods.
374+
* configure it. Either `pushConfig` or `bigQueryConfig` can be set, but not both. If both are
375+
* empty, then the subscriber will pull and ack messages using API methods.
376376
* @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits
377377
* for the subscriber to acknowledge receipt before resending the message. In the interval
378378
* after the message is delivered and before it is acknowledged, it is considered to be
@@ -439,8 +439,8 @@ public final Subscription createSubscription(
439439
* messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be
440440
* `_deleted-topic_` if the topic has been deleted.
441441
* @param pushConfig If push delivery is used with this subscription, this field is used to
442-
* configure it. An empty `pushConfig` signifies that the subscriber will pull and ack
443-
* messages using API methods.
442+
* configure it. Either `pushConfig` or `bigQueryConfig` can be set, but not both. If both are
443+
* empty, then the subscriber will pull and ack messages using API methods.
444444
* @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits
445445
* for the subscriber to acknowledge receipt before resending the message. In the interval
446446
* after the message is delivered and before it is acknowledged, it is considered to be
@@ -494,6 +494,7 @@ public final Subscription createSubscription(
494494
* .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
495495
* .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
496496
* .setPushConfig(PushConfig.newBuilder().build())
497+
* .setBigqueryConfig(BigQueryConfig.newBuilder().build())
497498
* .setAckDeadlineSeconds(2135351438)
498499
* .setRetainAckedMessages(true)
499500
* .setMessageRetentionDuration(Duration.newBuilder().build())
@@ -752,6 +753,7 @@ public final Subscription createSubscription(
752753
* .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
753754
* .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
754755
* .setPushConfig(PushConfig.newBuilder().build())
756+
* .setBigqueryConfig(BigQueryConfig.newBuilder().build())
755757
* .setAckDeadlineSeconds(2135351438)
756758
* .setRetainAckedMessages(true)
757759
* .setMessageRetentionDuration(Duration.newBuilder().build())

google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import com.google.protobuf.FieldMask;
4747
import com.google.protobuf.Timestamp;
4848
import com.google.pubsub.v1.AcknowledgeRequest;
49+
import com.google.pubsub.v1.BigQueryConfig;
4950
import com.google.pubsub.v1.CreateSnapshotRequest;
5051
import com.google.pubsub.v1.DeadLetterPolicy;
5152
import com.google.pubsub.v1.DeleteSnapshotRequest;
@@ -140,6 +141,7 @@ public void createSubscriptionTest() throws Exception {
140141
.setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
141142
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
142143
.setPushConfig(PushConfig.newBuilder().build())
144+
.setBigqueryConfig(BigQueryConfig.newBuilder().build())
143145
.setAckDeadlineSeconds(2135351438)
144146
.setRetainAckedMessages(true)
145147
.setMessageRetentionDuration(Duration.newBuilder().build())
@@ -202,6 +204,7 @@ public void createSubscriptionTest2() throws Exception {
202204
.setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
203205
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
204206
.setPushConfig(PushConfig.newBuilder().build())
207+
.setBigqueryConfig(BigQueryConfig.newBuilder().build())
205208
.setAckDeadlineSeconds(2135351438)
206209
.setRetainAckedMessages(true)
207210
.setMessageRetentionDuration(Duration.newBuilder().build())
@@ -264,6 +267,7 @@ public void createSubscriptionTest3() throws Exception {
264267
.setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
265268
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
266269
.setPushConfig(PushConfig.newBuilder().build())
270+
.setBigqueryConfig(BigQueryConfig.newBuilder().build())
267271
.setAckDeadlineSeconds(2135351438)
268272
.setRetainAckedMessages(true)
269273
.setMessageRetentionDuration(Duration.newBuilder().build())
@@ -326,6 +330,7 @@ public void createSubscriptionTest4() throws Exception {
326330
.setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
327331
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
328332
.setPushConfig(PushConfig.newBuilder().build())
333+
.setBigqueryConfig(BigQueryConfig.newBuilder().build())
329334
.setAckDeadlineSeconds(2135351438)
330335
.setRetainAckedMessages(true)
331336
.setMessageRetentionDuration(Duration.newBuilder().build())
@@ -388,6 +393,7 @@ public void getSubscriptionTest() throws Exception {
388393
.setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
389394
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
390395
.setPushConfig(PushConfig.newBuilder().build())
396+
.setBigqueryConfig(BigQueryConfig.newBuilder().build())
391397
.setAckDeadlineSeconds(2135351438)
392398
.setRetainAckedMessages(true)
393399
.setMessageRetentionDuration(Duration.newBuilder().build())
@@ -440,6 +446,7 @@ public void getSubscriptionTest2() throws Exception {
440446
.setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
441447
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
442448
.setPushConfig(PushConfig.newBuilder().build())
449+
.setBigqueryConfig(BigQueryConfig.newBuilder().build())
443450
.setAckDeadlineSeconds(2135351438)
444451
.setRetainAckedMessages(true)
445452
.setMessageRetentionDuration(Duration.newBuilder().build())
@@ -492,6 +499,7 @@ public void updateSubscriptionTest() throws Exception {
492499
.setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
493500
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
494501
.setPushConfig(PushConfig.newBuilder().build())
502+
.setBigqueryConfig(BigQueryConfig.newBuilder().build())
495503
.setAckDeadlineSeconds(2135351438)
496504
.setRetainAckedMessages(true)
497505
.setMessageRetentionDuration(Duration.newBuilder().build())

0 commit comments

Comments
 (0)