future = schemaServiceClient.listSchemasPagedCallable().futureCall(request);
* // Do something.
* for (Schema element : future.get().iterateAll()) {
* // doThingsWith(element);
@@ -503,7 +503,7 @@ public final ListSchemasPagedResponse listSchemas(ListSchemasRequest request) {
* .build();
* while (true) {
* ListSchemasResponse response = schemaServiceClient.listSchemasCallable().call(request);
- * for (Schema element : response.getSchemasList()) {
+ * for (Schema element : response.getResponsesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java
index 6d1c6950a..c3090f67d 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java
@@ -57,9 +57,11 @@
import com.google.pubsub.v1.SeekRequest;
import com.google.pubsub.v1.SeekResponse;
import com.google.pubsub.v1.Snapshot;
+import com.google.pubsub.v1.SnapshotName;
import com.google.pubsub.v1.StreamingPullRequest;
import com.google.pubsub.v1.StreamingPullResponse;
import com.google.pubsub.v1.Subscription;
+import com.google.pubsub.v1.SubscriptionName;
import com.google.pubsub.v1.TopicName;
import com.google.pubsub.v1.UpdateSnapshotRequest;
import com.google.pubsub.v1.UpdateSubscriptionRequest;
@@ -79,7 +81,7 @@
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
* PushConfig pushConfig = PushConfig.newBuilder().build();
* int ackDeadlineSeconds = 2135351438;
@@ -207,7 +209,7 @@ public SubscriberStub getStub() {
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
* PushConfig pushConfig = PushConfig.newBuilder().build();
* int ackDeadlineSeconds = 2135351438;
@@ -245,10 +247,7 @@ public SubscriberStub getStub() {
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Subscription createSubscription(
- ProjectSubscriptionName name,
- TopicName topic,
- PushConfig pushConfig,
- int ackDeadlineSeconds) {
+ SubscriptionName name, TopicName topic, PushConfig pushConfig, int ackDeadlineSeconds) {
Subscription request =
Subscription.newBuilder()
.setName(name == null ? null : name.toString())
@@ -276,7 +275,7 @@ public final Subscription createSubscription(
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
* PushConfig pushConfig = PushConfig.newBuilder().build();
* int ackDeadlineSeconds = 2135351438;
@@ -314,7 +313,7 @@ public final Subscription createSubscription(
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Subscription createSubscription(
- ProjectSubscriptionName name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) {
+ SubscriptionName name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) {
Subscription request =
Subscription.newBuilder()
.setName(name == null ? null : name.toString())
@@ -342,7 +341,7 @@ public final Subscription createSubscription(
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * String name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+ * String name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
* TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
* PushConfig pushConfig = PushConfig.newBuilder().build();
* int ackDeadlineSeconds = 2135351438;
@@ -408,7 +407,7 @@ public final Subscription createSubscription(
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * String name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+ * String name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
* String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
* PushConfig pushConfig = PushConfig.newBuilder().build();
* int ackDeadlineSeconds = 2135351438;
@@ -476,7 +475,7 @@ public final Subscription createSubscription(
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* Subscription request =
* Subscription.newBuilder()
- * .setName(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
* .setPushConfig(PushConfig.newBuilder().build())
* .setAckDeadlineSeconds(2135351438)
@@ -554,8 +553,8 @@ public final Subscription createSubscription(Subscription request) {
* If the subscriber never acknowledges the message, the Pub/Sub system will eventually
* redeliver the message.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
- * @deprecated Use {@link #createSubscription(ProjectSubscriptionName, TopicName, PushConfig,
- * int)} instead.
+ * @deprecated Use {@link #createSubscription(SubscriptionName, TopicName, PushConfig, int)}
+ * instead.
*/
@Deprecated
public final Subscription createSubscription(
@@ -573,6 +572,145 @@ public final Subscription createSubscription(
return createSubscription(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a subscription to a given topic. See the [resource name rules]
+ * (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already
+ * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns
+ * `NOT_FOUND`.
+ *
+ *
If the name is not provided in the request, the server will assign a random name for this
+ * subscription on the same project as the topic, conforming to the [resource name format]
+ * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in
+ * the returned Subscription object. Note that for REST API requests, you must specify a name in
+ * the request.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
+ * PushConfig pushConfig = PushConfig.newBuilder().build();
+ * int ackDeadlineSeconds = 2135351438;
+ * Subscription response =
+ * subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
+ * }
+ * }
+ *
+ * @param name Required. The name of the subscription. It must have the format
+ * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a
+ * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores
+ * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3
+ * and 255 characters in length, and it must not start with `"goog"`.
+ * @param topic Required. The name of the topic from which this subscription is receiving
+ * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be
+ * `_deleted-topic_` if the topic has been deleted.
+ * @param 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.
+ * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits
+ * for the subscriber to acknowledge receipt before resending the message. In the interval
+ * after the message is delivered and before it is acknowledged, it is considered to be
+ * <i>outstanding</i>. During that time period, the message will not be
+ * redelivered (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 `ModifyAckDeadline` with the corresponding
+ * `ack_id` if using non-streaming pull or send the `ack_id` in a
+ * `StreamingModifyAckDeadlineRequest` if using streaming 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.
+ * @deprecated Use {@link #createSubscription(SubscriptionName, String, PushConfig, int)} instead.
+ */
+ @Deprecated
+ public final Subscription createSubscription(
+ ProjectSubscriptionName name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) {
+ Subscription request =
+ Subscription.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setTopic(topic)
+ .setPushConfig(pushConfig)
+ .setAckDeadlineSeconds(ackDeadlineSeconds)
+ .build();
+ return createSubscription(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a subscription to a given topic. See the [resource name rules]
+ * (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already
+ * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns
+ * `NOT_FOUND`.
+ *
+ *
If the name is not provided in the request, the server will assign a random name for this
+ * subscription on the same project as the topic, conforming to the [resource name format]
+ * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in
+ * the returned Subscription object. Note that for REST API requests, you must specify a name in
+ * the request.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
+ * PushConfig pushConfig = PushConfig.newBuilder().build();
+ * int ackDeadlineSeconds = 2135351438;
+ * Subscription response =
+ * subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
+ * }
+ * }
+ *
+ * @param name Required. The name of the subscription. It must have the format
+ * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a
+ * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores
+ * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3
+ * and 255 characters in length, and it must not start with `"goog"`.
+ * @param topic Required. The name of the topic from which this subscription is receiving
+ * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be
+ * `_deleted-topic_` if the topic has been deleted.
+ * @param 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.
+ * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits
+ * for the subscriber to acknowledge receipt before resending the message. In the interval
+ * after the message is delivered and before it is acknowledged, it is considered to be
+ * <i>outstanding</i>. During that time period, the message will not be
+ * redelivered (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 `ModifyAckDeadline` with the corresponding
+ * `ack_id` if using non-streaming pull or send the `ack_id` in a
+ * `StreamingModifyAckDeadlineRequest` if using streaming 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.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #createSubscription(SubscriptionName, TopicName, PushConfig, int)}
+ * instead.
+ */
+ @Deprecated
+ public final Subscription createSubscription(
+ ProjectSubscriptionName name,
+ TopicName topic,
+ PushConfig pushConfig,
+ int ackDeadlineSeconds) {
+ Subscription request =
+ Subscription.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setTopic(topic == null ? null : topic.toString())
+ .setPushConfig(pushConfig)
+ .setAckDeadlineSeconds(ackDeadlineSeconds)
+ .build();
+ return createSubscription(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a subscription to a given topic. See the [resource name rules]
@@ -592,7 +730,7 @@ public final Subscription createSubscription(
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* Subscription request =
* Subscription.newBuilder()
- * .setName(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
* .setPushConfig(PushConfig.newBuilder().build())
* .setAckDeadlineSeconds(2135351438)
@@ -626,7 +764,7 @@ public final UnaryCallable createSubscriptionCallabl
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* Subscription response = subscriptionAdminClient.getSubscription(subscription);
* }
* }
@@ -635,7 +773,7 @@ public final UnaryCallable createSubscriptionCallabl
* `projects/{project}/subscriptions/{sub}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Subscription getSubscription(ProjectSubscriptionName subscription) {
+ public final Subscription getSubscription(SubscriptionName subscription) {
GetSubscriptionRequest request =
GetSubscriptionRequest.newBuilder()
.setSubscription(subscription == null ? null : subscription.toString())
@@ -651,7 +789,7 @@ public final Subscription getSubscription(ProjectSubscriptionName subscription)
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+ * String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
* Subscription response = subscriptionAdminClient.getSubscription(subscription);
* }
* }
@@ -676,7 +814,7 @@ public final Subscription getSubscription(String subscription) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* GetSubscriptionRequest request =
* GetSubscriptionRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .build();
* Subscription response = subscriptionAdminClient.getSubscription(request);
* }
@@ -689,6 +827,33 @@ public final Subscription getSubscription(GetSubscriptionRequest request) {
return getSubscriptionCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the configuration details of a subscription.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * Subscription response = subscriptionAdminClient.getSubscription(subscription);
+ * }
+ * }
+ *
+ * @param subscription Required. The name of the subscription to get. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #getSubscription(SubscriptionName)} instead.
+ */
+ @Deprecated
+ public final Subscription getSubscription(ProjectSubscriptionName subscription) {
+ GetSubscriptionRequest request =
+ GetSubscriptionRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .build();
+ return getSubscription(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the configuration details of a subscription.
@@ -699,7 +864,7 @@ public final Subscription getSubscription(GetSubscriptionRequest request) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* GetSubscriptionRequest request =
* GetSubscriptionRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .build();
* ApiFuture future =
* subscriptionAdminClient.getSubscriptionCallable().futureCall(request);
@@ -855,7 +1020,7 @@ public final ListSubscriptionsPagedResponse listSubscriptions(ListSubscriptionsR
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
- * ApiFuture future =
+ * ApiFuture future =
* subscriptionAdminClient.listSubscriptionsPagedCallable().futureCall(request);
* // Do something.
* for (Subscription element : future.get().iterateAll()) {
@@ -886,7 +1051,7 @@ public final ListSubscriptionsPagedResponse listSubscriptions(ListSubscriptionsR
* while (true) {
* ListSubscriptionsResponse response =
* subscriptionAdminClient.listSubscriptionsCallable().call(request);
- * for (Subscription element : response.getSubscriptionsList()) {
+ * for (Subscription element : response.getResponsesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -915,7 +1080,7 @@ public final ListSubscriptionsPagedResponse listSubscriptions(ListSubscriptionsR
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* subscriptionAdminClient.deleteSubscription(subscription);
* }
* }
@@ -924,7 +1089,7 @@ public final ListSubscriptionsPagedResponse listSubscriptions(ListSubscriptionsR
* `projects/{project}/subscriptions/{sub}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteSubscription(ProjectSubscriptionName subscription) {
+ public final void deleteSubscription(SubscriptionName subscription) {
DeleteSubscriptionRequest request =
DeleteSubscriptionRequest.newBuilder()
.setSubscription(subscription == null ? null : subscription.toString())
@@ -943,7 +1108,7 @@ public final void deleteSubscription(ProjectSubscriptionName subscription) {
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+ * String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
* subscriptionAdminClient.deleteSubscription(subscription);
* }
* }
@@ -971,7 +1136,7 @@ public final void deleteSubscription(String subscription) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* DeleteSubscriptionRequest request =
* DeleteSubscriptionRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .build();
* subscriptionAdminClient.deleteSubscription(request);
* }
@@ -984,6 +1149,36 @@ public final void deleteSubscription(DeleteSubscriptionRequest request) {
deleteSubscriptionCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes an existing subscription. All messages retained in the subscription are immediately
+ * dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is
+ * deleted, a new one may be created with the same name, but the new one has no association with
+ * the old subscription or its topic unless the same topic is specified.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * subscriptionAdminClient.deleteSubscription(subscription);
+ * }
+ * }
+ *
+ * @param subscription Required. The subscription to delete. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #deleteSubscription(SubscriptionName)} instead.
+ */
+ @Deprecated
+ public final void deleteSubscription(ProjectSubscriptionName subscription) {
+ DeleteSubscriptionRequest request =
+ DeleteSubscriptionRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .build();
+ deleteSubscription(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes an existing subscription. All messages retained in the subscription are immediately
@@ -997,7 +1192,7 @@ public final void deleteSubscription(DeleteSubscriptionRequest request) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* DeleteSubscriptionRequest request =
* DeleteSubscriptionRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .build();
* ApiFuture future =
* subscriptionAdminClient.deleteSubscriptionCallable().futureCall(request);
@@ -1021,7 +1216,7 @@ public final UnaryCallable deleteSubscriptionC
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* List ackIds = new ArrayList<>();
* int ackDeadlineSeconds = 2135351438;
* subscriptionAdminClient.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds);
@@ -1040,8 +1235,8 @@ public final UnaryCallable deleteSubscriptionC
* 600 seconds (10 minutes).
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- /* package-private */ final void modifyAckDeadline(
- ProjectSubscriptionName subscription, List ackIds, int ackDeadlineSeconds) {
+ public final void modifyAckDeadline(
+ SubscriptionName subscription, List ackIds, int ackDeadlineSeconds) {
ModifyAckDeadlineRequest request =
ModifyAckDeadlineRequest.newBuilder()
.setSubscription(subscription == null ? null : subscription.toString())
@@ -1062,7 +1257,7 @@ public final UnaryCallable deleteSubscriptionC
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+ * String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
* List ackIds = new ArrayList<>();
* int ackDeadlineSeconds = 2135351438;
* subscriptionAdminClient.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds);
@@ -1105,7 +1300,7 @@ public final void modifyAckDeadline(
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* ModifyAckDeadlineRequest request =
* ModifyAckDeadlineRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .addAllAckIds(new ArrayList())
* .setAckDeadlineSeconds(2135351438)
* .build();
@@ -1120,6 +1315,49 @@ public final void modifyAckDeadline(ModifyAckDeadlineRequest request) {
modifyAckDeadlineCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Modifies the ack deadline for a specific message. This method is useful to indicate that more
+ * time is needed to process a message by the subscriber, or to make the message available for
+ * redelivery if the processing was interrupted. Note that this does not modify the
+ * subscription-level `ackDeadlineSeconds` used for subsequent messages.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * List ackIds = new ArrayList<>();
+ * int ackDeadlineSeconds = 2135351438;
+ * subscriptionAdminClient.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds);
+ * }
+ * }
+ *
+ * @param subscription Required. The name of the subscription. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @param ackIds Required. List of acknowledgment IDs.
+ * @param ackDeadlineSeconds Required. The new ack deadline with respect to the time this request
+ * was sent to the Pub/Sub system. For example, if the value is 10, the new ack deadline will
+ * expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying zero might
+ * immediately make the message available for delivery to another subscriber client. This
+ * typically results in an increase in the rate of message redeliveries (that is, duplicates).
+ * The minimum deadline you can specify is 0 seconds. The maximum deadline you can specify is
+ * 600 seconds (10 minutes).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #modifyAckDeadline(SubscriptionName, List, int)} instead.
+ */
+ @Deprecated
+ final void modifyAckDeadline(
+ ProjectSubscriptionName subscription, List ackIds, int ackDeadlineSeconds) {
+ ModifyAckDeadlineRequest request =
+ ModifyAckDeadlineRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .addAllAckIds(ackIds)
+ .setAckDeadlineSeconds(ackDeadlineSeconds)
+ .build();
+ modifyAckDeadline(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Modifies the ack deadline for a specific message. This method is useful to indicate that more
@@ -1133,7 +1371,7 @@ public final void modifyAckDeadline(ModifyAckDeadlineRequest request) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* ModifyAckDeadlineRequest request =
* ModifyAckDeadlineRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .addAllAckIds(new ArrayList())
* .setAckDeadlineSeconds(2135351438)
* .build();
@@ -1160,7 +1398,7 @@ public final UnaryCallable modifyAckDeadlineCal
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* List ackIds = new ArrayList<>();
* subscriptionAdminClient.acknowledge(subscription, ackIds);
* }
@@ -1172,7 +1410,7 @@ public final UnaryCallable modifyAckDeadlineCal
* returned by the Pub/Sub system in the `Pull` response. Must not be empty.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void acknowledge(ProjectSubscriptionName subscription, List ackIds) {
+ public final void acknowledge(SubscriptionName subscription, List ackIds) {
AcknowledgeRequest request =
AcknowledgeRequest.newBuilder()
.setSubscription(subscription == null ? null : subscription.toString())
@@ -1193,7 +1431,7 @@ public final void acknowledge(ProjectSubscriptionName subscription, List
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+ * String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
* List ackIds = new ArrayList<>();
* subscriptionAdminClient.acknowledge(subscription, ackIds);
* }
@@ -1225,7 +1463,7 @@ public final void acknowledge(String subscription, List ackIds) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* AcknowledgeRequest request =
* AcknowledgeRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .addAllAckIds(new ArrayList())
* .build();
* subscriptionAdminClient.acknowledge(request);
@@ -1251,10 +1489,45 @@ public final void acknowledge(AcknowledgeRequest request) {
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * AcknowledgeRequest request =
- * AcknowledgeRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
- * .addAllAckIds(new ArrayList())
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * List ackIds = new ArrayList<>();
+ * subscriptionAdminClient.acknowledge(subscription, ackIds);
+ * }
+ * }
+ *
+ * @param subscription Required. The subscription whose message is being acknowledged. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @param ackIds Required. The acknowledgment ID for the messages being acknowledged that was
+ * returned by the Pub/Sub system in the `Pull` response. Must not be empty.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #acknowledge(SubscriptionName, List)} instead.
+ */
+ @Deprecated
+ public final void acknowledge(ProjectSubscriptionName subscription, List ackIds) {
+ AcknowledgeRequest request =
+ AcknowledgeRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .addAllAckIds(ackIds)
+ .build();
+ acknowledge(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The
+ * Pub/Sub system can remove the relevant messages from the subscription.
+ *
+ * Acknowledging a message whose ack deadline has expired may succeed, but such a message may
+ * be redelivered later. Acknowledging a message more than once will not result in an error.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * AcknowledgeRequest request =
+ * AcknowledgeRequest.newBuilder()
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .addAllAckIds(new ArrayList())
* .build();
* ApiFuture future = subscriptionAdminClient.acknowledgeCallable().futureCall(request);
* // Do something.
@@ -1275,7 +1548,7 @@ public final UnaryCallable acknowledgeCallable() {
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* int maxMessages = 496131527;
* PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages);
* }
@@ -1287,7 +1560,7 @@ public final UnaryCallable acknowledgeCallable() {
* a positive integer. The Pub/Sub system may return fewer than the number specified.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final PullResponse pull(ProjectSubscriptionName subscription, int maxMessages) {
+ public final PullResponse pull(SubscriptionName subscription, int maxMessages) {
PullRequest request =
PullRequest.newBuilder()
.setSubscription(subscription == null ? null : subscription.toString())
@@ -1305,7 +1578,7 @@ public final PullResponse pull(ProjectSubscriptionName subscription, int maxMess
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+ * String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
* int maxMessages = 496131527;
* PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages);
* }
@@ -1332,7 +1605,7 @@ public final PullResponse pull(String subscription, int maxMessages) {
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* boolean returnImmediately = true;
* int maxMessages = 496131527;
* PullResponse response =
@@ -1352,8 +1625,8 @@ public final PullResponse pull(String subscription, int maxMessages) {
* a positive integer. The Pub/Sub system may return fewer than the number specified.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- /* package-private */ final PullResponse pull(
- ProjectSubscriptionName subscription, boolean returnImmediately, int maxMessages) {
+ public final PullResponse pull(
+ SubscriptionName subscription, boolean returnImmediately, int maxMessages) {
PullRequest request =
PullRequest.newBuilder()
.setSubscription(subscription == null ? null : subscription.toString())
@@ -1372,7 +1645,7 @@ public final PullResponse pull(String subscription, int maxMessages) {
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+ * String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
* boolean returnImmediately = true;
* int maxMessages = 496131527;
* PullResponse response =
@@ -1413,7 +1686,7 @@ public final PullResponse pull(String subscription, boolean returnImmediately, i
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* PullRequest request =
* PullRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .setReturnImmediately(true)
* .setMaxMessages(496131527)
* .build();
@@ -1428,6 +1701,80 @@ public final PullResponse pull(PullRequest request) {
return pullCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many
+ * concurrent pull requests pending for the given subscription.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * int maxMessages = 496131527;
+ * PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages);
+ * }
+ * }
+ *
+ * @param subscription Required. The subscription from which messages should be pulled. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @param maxMessages Required. The maximum number of messages to return for this request. Must be
+ * a positive integer. The Pub/Sub system may return fewer than the number specified.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #pull(SubscriptionName, int)} instead.
+ */
+ @Deprecated
+ public final PullResponse pull(ProjectSubscriptionName subscription, int maxMessages) {
+ PullRequest request =
+ PullRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .setMaxMessages(maxMessages)
+ .build();
+ return pull(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many
+ * concurrent pull requests pending for the given subscription.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * boolean returnImmediately = true;
+ * int maxMessages = 496131527;
+ * PullResponse response =
+ * subscriptionAdminClient.pull(subscription, returnImmediately, maxMessages);
+ * }
+ * }
+ *
+ * @param subscription Required. The subscription from which messages should be pulled. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @param returnImmediately Optional. If this field set to true, the system will respond
+ * immediately even if it there are no messages available to return in the `Pull` response.
+ * Otherwise, the system may wait (for a bounded amount of time) until at least one message is
+ * available, rather than returning no messages. Warning: setting this field to `true` is
+ * discouraged because it adversely impacts the performance of `Pull` operations. We recommend
+ * that users do not set this field.
+ * @param maxMessages Required. The maximum number of messages to return for this request. Must be
+ * a positive integer. The Pub/Sub system may return fewer than the number specified.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #pull(SubscriptionName, boolean, int)} instead.
+ */
+ @Deprecated
+ final PullResponse pull(
+ ProjectSubscriptionName subscription, boolean returnImmediately, int maxMessages) {
+ PullRequest request =
+ PullRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .setReturnImmediately(returnImmediately)
+ .setMaxMessages(maxMessages)
+ .build();
+ return pull(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many
@@ -1439,7 +1786,7 @@ public final PullResponse pull(PullRequest request) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* PullRequest request =
* PullRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .setReturnImmediately(true)
* .setMaxMessages(496131527)
* .build();
@@ -1470,7 +1817,7 @@ public final UnaryCallable pullCallable() {
* subscriptionAdminClient.streamingPullCallable().call();
* StreamingPullRequest request =
* StreamingPullRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .addAllAckIds(new ArrayList())
* .addAllModifyDeadlineSeconds(new ArrayList())
* .addAllModifyDeadlineAckIds(new ArrayList())
@@ -1504,7 +1851,7 @@ public final UnaryCallable pullCallable() {
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* PushConfig pushConfig = PushConfig.newBuilder().build();
* subscriptionAdminClient.modifyPushConfig(subscription, pushConfig);
* }
@@ -1518,7 +1865,7 @@ public final UnaryCallable pullCallable() {
* pausing the subscription if `Pull` or `StreamingPull` is not called.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void modifyPushConfig(ProjectSubscriptionName subscription, PushConfig pushConfig) {
+ public final void modifyPushConfig(SubscriptionName subscription, PushConfig pushConfig) {
ModifyPushConfigRequest request =
ModifyPushConfigRequest.newBuilder()
.setSubscription(subscription == null ? null : subscription.toString())
@@ -1540,7 +1887,7 @@ public final void modifyPushConfig(ProjectSubscriptionName subscription, PushCon
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+ * String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
* PushConfig pushConfig = PushConfig.newBuilder().build();
* subscriptionAdminClient.modifyPushConfig(subscription, pushConfig);
* }
@@ -1578,7 +1925,7 @@ public final void modifyPushConfig(String subscription, PushConfig pushConfig) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* ModifyPushConfigRequest request =
* ModifyPushConfigRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .setPushConfig(PushConfig.newBuilder().build())
* .build();
* subscriptionAdminClient.modifyPushConfig(request);
@@ -1592,6 +1939,44 @@ public final void modifyPushConfig(ModifyPushConfigRequest request) {
modifyPushConfigCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Modifies the `PushConfig` for a specified subscription.
+ *
+ * This may be used to change a push subscription to a pull one (signified by an empty
+ * `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push
+ * subscription. Messages will accumulate for delivery continuously through the call regardless of
+ * changes to the `PushConfig`.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * PushConfig pushConfig = PushConfig.newBuilder().build();
+ * subscriptionAdminClient.modifyPushConfig(subscription, pushConfig);
+ * }
+ * }
+ *
+ * @param subscription Required. The name of the subscription. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @param pushConfig Required. The push configuration for future deliveries.
+ * An empty `pushConfig` indicates that the Pub/Sub system should stop pushing messages
+ * from the given subscription and allow messages to be pulled and acknowledged - effectively
+ * pausing the subscription if `Pull` or `StreamingPull` is not called.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #modifyPushConfig(SubscriptionName, PushConfig)} instead.
+ */
+ @Deprecated
+ public final void modifyPushConfig(ProjectSubscriptionName subscription, PushConfig pushConfig) {
+ ModifyPushConfigRequest request =
+ ModifyPushConfigRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .setPushConfig(pushConfig)
+ .build();
+ modifyPushConfig(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Modifies the `PushConfig` for a specified subscription.
@@ -1607,7 +1992,7 @@ public final void modifyPushConfig(ModifyPushConfigRequest request) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* ModifyPushConfigRequest request =
* ModifyPushConfigRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .setPushConfig(PushConfig.newBuilder().build())
* .build();
* ApiFuture future =
@@ -1632,7 +2017,7 @@ public final UnaryCallable modifyPushConfigCalla
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ * SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
* Snapshot response = subscriptionAdminClient.getSnapshot(snapshot);
* }
* }
@@ -1641,7 +2026,7 @@ public final UnaryCallable modifyPushConfigCalla
* `projects/{project}/snapshots/{snap}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Snapshot getSnapshot(ProjectSnapshotName snapshot) {
+ public final Snapshot getSnapshot(SnapshotName snapshot) {
GetSnapshotRequest request =
GetSnapshotRequest.newBuilder()
.setSnapshot(snapshot == null ? null : snapshot.toString())
@@ -1660,7 +2045,7 @@ public final Snapshot getSnapshot(ProjectSnapshotName snapshot) {
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * String snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
+ * String snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
* Snapshot response = subscriptionAdminClient.getSnapshot(snapshot);
* }
* }
@@ -1687,7 +2072,7 @@ public final Snapshot getSnapshot(String snapshot) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* GetSnapshotRequest request =
* GetSnapshotRequest.newBuilder()
- * .setSnapshot(ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
+ * .setSnapshot(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
* .build();
* Snapshot response = subscriptionAdminClient.getSnapshot(request);
* }
@@ -1700,6 +2085,36 @@ public final Snapshot getSnapshot(GetSnapshotRequest request) {
return getSnapshotCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the configuration details of a snapshot. Snapshots are used in <a
+ * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which
+ * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment
+ * state of messages in an existing subscription to the state captured by a snapshot.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ * Snapshot response = subscriptionAdminClient.getSnapshot(snapshot);
+ * }
+ * }
+ *
+ * @param snapshot Required. The name of the snapshot to get. Format is
+ * `projects/{project}/snapshots/{snap}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use Use {@link #getSnapshot(SnapshotName)} instead.
+ */
+ @Deprecated
+ public final Snapshot getSnapshot(ProjectSnapshotName snapshot) {
+ GetSnapshotRequest request =
+ GetSnapshotRequest.newBuilder()
+ .setSnapshot(snapshot == null ? null : snapshot.toString())
+ .build();
+ return getSnapshot(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the configuration details of a snapshot. Snapshots are used in <a
@@ -1713,7 +2128,7 @@ public final Snapshot getSnapshot(GetSnapshotRequest request) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* GetSnapshotRequest request =
* GetSnapshotRequest.newBuilder()
- * .setSnapshot(ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
+ * .setSnapshot(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
* .build();
* ApiFuture future =
* subscriptionAdminClient.getSnapshotCallable().futureCall(request);
@@ -1830,7 +2245,7 @@ public final ListSnapshotsPagedResponse listSnapshots(ListSnapshotsRequest reque
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
- * ApiFuture future =
+ * ApiFuture future =
* subscriptionAdminClient.listSnapshotsPagedCallable().futureCall(request);
* // Do something.
* for (Snapshot element : future.get().iterateAll()) {
@@ -1864,7 +2279,7 @@ public final ListSnapshotsPagedResponse listSnapshots(ListSnapshotsRequest reque
* while (true) {
* ListSnapshotsResponse response =
* subscriptionAdminClient.listSnapshotsCallable().call(request);
- * for (Snapshot element : response.getSnapshotsList()) {
+ * for (Snapshot element : response.getResponsesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -1900,8 +2315,8 @@ public final UnaryCallable listSnap
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
- * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ * SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
* }
* }
@@ -1920,8 +2335,7 @@ public final UnaryCallable listSnap
* `projects/{project}/subscriptions/{sub}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Snapshot createSnapshot(
- ProjectSnapshotName name, ProjectSubscriptionName subscription) {
+ public final Snapshot createSnapshot(SnapshotName name, SubscriptionName subscription) {
CreateSnapshotRequest request =
CreateSnapshotRequest.newBuilder()
.setName(name == null ? null : name.toString())
@@ -1949,8 +2363,8 @@ public final Snapshot createSnapshot(
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
- * String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+ * SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ * String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
* Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
* }
* }
@@ -1969,7 +2383,7 @@ public final Snapshot createSnapshot(
* `projects/{project}/subscriptions/{sub}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Snapshot createSnapshot(ProjectSnapshotName name, String subscription) {
+ public final Snapshot createSnapshot(SnapshotName name, String subscription) {
CreateSnapshotRequest request =
CreateSnapshotRequest.newBuilder()
.setName(name == null ? null : name.toString())
@@ -1997,8 +2411,8 @@ public final Snapshot createSnapshot(ProjectSnapshotName name, String subscripti
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * String name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
- * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * String name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
+ * SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
* }
* }
@@ -2017,7 +2431,7 @@ public final Snapshot createSnapshot(ProjectSnapshotName name, String subscripti
* `projects/{project}/subscriptions/{sub}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final Snapshot createSnapshot(String name, ProjectSubscriptionName subscription) {
+ public final Snapshot createSnapshot(String name, SubscriptionName subscription) {
CreateSnapshotRequest request =
CreateSnapshotRequest.newBuilder()
.setName(name)
@@ -2045,8 +2459,8 @@ public final Snapshot createSnapshot(String name, ProjectSubscriptionName subscr
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * String name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
- * String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+ * String name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
+ * String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
* Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
* }
* }
@@ -2092,8 +2506,8 @@ public final Snapshot createSnapshot(String name, String subscription) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* CreateSnapshotRequest request =
* CreateSnapshotRequest.newBuilder()
- * .setName(ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .putAllLabels(new HashMap())
* .build();
* Snapshot response = subscriptionAdminClient.createSnapshot(request);
@@ -2107,6 +2521,157 @@ public final Snapshot createSnapshot(CreateSnapshotRequest request) {
return createSnapshotCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a snapshot from the requested subscription. Snapshots are used in
+ * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to
+ * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of
+ * messages in an existing subscription to the state captured by a snapshot. If the snapshot
+ * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns
+ * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would
+ * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the
+ * `Snapshot.expire_time` field. If the name is not provided in the request, the server will
+ * assign a random name for this snapshot on the same project as the subscription, conforming to
+ * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The
+ * generated name is populated in the returned Snapshot object. Note that for REST API requests,
+ * you must specify a name in the request.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
+ * }
+ * }
+ *
+ * @param name Required. User-provided name for this snapshot. If the name is not provided in the
+ * request, the server will assign a random name for this snapshot on the same project as the
+ * subscription. Note that for REST API requests, you must specify a name. See the <a
+ * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name
+ * rules</a>. Format is `projects/{project}/snapshots/{snap}`.
+ * @param subscription Required. The subscription whose backlog the snapshot retains.
+ * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the
+ * subscription. More precisely, this is defined as the messages in the subscription's backlog
+ * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as
+ * well as: (b) Any messages published to the subscription's topic following the successful
+ * completion of the CreateSnapshot request. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use Use {@link #createSnapshot(SnapshotName, SubscriptionName)} instead.
+ */
+ @Deprecated
+ public final Snapshot createSnapshot(
+ ProjectSnapshotName name, ProjectSubscriptionName subscription) {
+ CreateSnapshotRequest request =
+ CreateSnapshotRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .build();
+ return createSnapshot(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a snapshot from the requested subscription. Snapshots are used in
+ * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to
+ * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of
+ * messages in an existing subscription to the state captured by a snapshot. If the snapshot
+ * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns
+ * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would
+ * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the
+ * `Snapshot.expire_time` field. If the name is not provided in the request, the server will
+ * assign a random name for this snapshot on the same project as the subscription, conforming to
+ * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The
+ * generated name is populated in the returned Snapshot object. Note that for REST API requests,
+ * you must specify a name in the request.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * String name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
+ * }
+ * }
+ *
+ * @param name Required. User-provided name for this snapshot. If the name is not provided in the
+ * request, the server will assign a random name for this snapshot on the same project as the
+ * subscription. Note that for REST API requests, you must specify a name. See the <a
+ * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name
+ * rules</a>. Format is `projects/{project}/snapshots/{snap}`.
+ * @param subscription Required. The subscription whose backlog the snapshot retains.
+ * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the
+ * subscription. More precisely, this is defined as the messages in the subscription's backlog
+ * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as
+ * well as: (b) Any messages published to the subscription's topic following the successful
+ * completion of the CreateSnapshot request. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use Use {@link #createSnapshot(String, SubscriptionName)} instead.
+ */
+ @Deprecated
+ public final Snapshot createSnapshot(String name, ProjectSubscriptionName subscription) {
+ CreateSnapshotRequest request =
+ CreateSnapshotRequest.newBuilder()
+ .setName(name)
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .build();
+ return createSnapshot(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a snapshot from the requested subscription. Snapshots are used in
+ * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to
+ * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of
+ * messages in an existing subscription to the state captured by a snapshot. If the snapshot
+ * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns
+ * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would
+ * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the
+ * `Snapshot.expire_time` field. If the name is not provided in the request, the server will
+ * assign a random name for this snapshot on the same project as the subscription, conforming to
+ * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The
+ * generated name is populated in the returned Snapshot object. Note that for REST API requests,
+ * you must specify a name in the request.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ * String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+ * Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
+ * }
+ * }
+ *
+ * @param name Required. User-provided name for this snapshot. If the name is not provided in the
+ * request, the server will assign a random name for this snapshot on the same project as the
+ * subscription. Note that for REST API requests, you must specify a name. See the <a
+ * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name
+ * rules</a>. Format is `projects/{project}/snapshots/{snap}`.
+ * @param subscription Required. The subscription whose backlog the snapshot retains.
+ * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the
+ * subscription. More precisely, this is defined as the messages in the subscription's backlog
+ * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as
+ * well as: (b) Any messages published to the subscription's topic following the successful
+ * completion of the CreateSnapshot request. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use Use {@link #createSnapshot(SnapshotName, String)} instead.
+ */
+ @Deprecated
+ public final Snapshot createSnapshot(ProjectSnapshotName name, String subscription) {
+ CreateSnapshotRequest request =
+ CreateSnapshotRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setSubscription(subscription)
+ .build();
+ return createSnapshot(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a snapshot from the requested subscription. Snapshots are used in
@@ -2128,8 +2693,8 @@ public final Snapshot createSnapshot(CreateSnapshotRequest request) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* CreateSnapshotRequest request =
* CreateSnapshotRequest.newBuilder()
- * .setName(ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .putAllLabels(new HashMap())
* .build();
* ApiFuture future =
@@ -2211,7 +2776,7 @@ public final UnaryCallable updateSnapshotCallab
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ * SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
* subscriptionAdminClient.deleteSnapshot(snapshot);
* }
* }
@@ -2220,7 +2785,7 @@ public final UnaryCallable updateSnapshotCallab
* `projects/{project}/snapshots/{snap}`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
- public final void deleteSnapshot(ProjectSnapshotName snapshot) {
+ public final void deleteSnapshot(SnapshotName snapshot) {
DeleteSnapshotRequest request =
DeleteSnapshotRequest.newBuilder()
.setSnapshot(snapshot == null ? null : snapshot.toString())
@@ -2242,7 +2807,7 @@ public final void deleteSnapshot(ProjectSnapshotName snapshot) {
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * String snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
+ * String snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
* subscriptionAdminClient.deleteSnapshot(snapshot);
* }
* }
@@ -2273,7 +2838,7 @@ public final void deleteSnapshot(String snapshot) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* DeleteSnapshotRequest request =
* DeleteSnapshotRequest.newBuilder()
- * .setSnapshot(ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
+ * .setSnapshot(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
* .build();
* subscriptionAdminClient.deleteSnapshot(request);
* }
@@ -2286,6 +2851,39 @@ public final void deleteSnapshot(DeleteSnapshotRequest request) {
deleteSnapshotCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Removes an existing snapshot. Snapshots are used in [Seek]
+ * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage
+ * message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in
+ * an existing subscription to the state captured by a snapshot. When the snapshot is deleted, all
+ * messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new
+ * one may be created with the same name, but the new one has no association with the old snapshot
+ * or its subscription, unless the same subscription is specified.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ * subscriptionAdminClient.deleteSnapshot(snapshot);
+ * }
+ * }
+ *
+ * @param snapshot Required. The name of the snapshot to delete. Format is
+ * `projects/{project}/snapshots/{snap}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use Use {@link #deleteSnapshot(SnapshotName)} instead.
+ */
+ @Deprecated
+ public final void deleteSnapshot(ProjectSnapshotName snapshot) {
+ DeleteSnapshotRequest request =
+ DeleteSnapshotRequest.newBuilder()
+ .setSnapshot(snapshot == null ? null : snapshot.toString())
+ .build();
+ deleteSnapshot(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Removes an existing snapshot. Snapshots are used in [Seek]
@@ -2302,7 +2900,7 @@ public final void deleteSnapshot(DeleteSnapshotRequest request) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* DeleteSnapshotRequest request =
* DeleteSnapshotRequest.newBuilder()
- * .setSnapshot(ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
+ * .setSnapshot(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
* .build();
* ApiFuture future =
* subscriptionAdminClient.deleteSnapshotCallable().futureCall(request);
@@ -2330,7 +2928,7 @@ public final UnaryCallable deleteSnapshotCallable(
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* SeekRequest request =
* SeekRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .build();
* SeekResponse response = subscriptionAdminClient.seek(request);
* }
@@ -2358,7 +2956,7 @@ public final SeekResponse seek(SeekRequest request) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* SeekRequest request =
* SeekRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .build();
* ApiFuture future = subscriptionAdminClient.seekCallable().futureCall(request);
* // Do something.
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java
index 1a9ba2887..61b154c1e 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java
@@ -27,8 +27,6 @@
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.pubsub.v1.stub.PublisherStub;
import com.google.cloud.pubsub.v1.stub.PublisherStubSettings;
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
@@ -47,7 +45,6 @@
import com.google.pubsub.v1.ListTopicsRequest;
import com.google.pubsub.v1.ListTopicsResponse;
import com.google.pubsub.v1.ProjectName;
-import com.google.pubsub.v1.ProjectSubscriptionName;
import com.google.pubsub.v1.ProjectTopicName;
import com.google.pubsub.v1.PublishRequest;
import com.google.pubsub.v1.PublishResponse;
@@ -666,7 +663,7 @@ public final ListTopicsPagedResponse listTopics(ListTopicsRequest request) {
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
- * ApiFuture future = topicAdminClient.listTopicsPagedCallable().futureCall(request);
+ * ApiFuture future = topicAdminClient.listTopicsPagedCallable().futureCall(request);
* // Do something.
* for (Topic element : future.get().iterateAll()) {
* // doThingsWith(element);
@@ -694,7 +691,7 @@ public final UnaryCallable listTopic
* .build();
* while (true) {
* ListTopicsResponse response = topicAdminClient.listTopicsCallable().call(request);
- * for (Topic element : response.getTopicsList()) {
+ * for (Topic element : response.getResponsesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -834,7 +831,7 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
- * ApiFuture future =
+ * ApiFuture future =
* topicAdminClient.listTopicSubscriptionsPagedCallable().futureCall(request);
* // Do something.
* for (String element : future.get().iterateAll()) {
@@ -865,7 +862,7 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(
* while (true) {
* ListTopicSubscriptionsResponse response =
* topicAdminClient.listTopicSubscriptionsCallable().call(request);
- * for (String element : response.getSubscriptionsList()) {
+ * for (String element : response.getResponsesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -989,7 +986,7 @@ public final ListTopicSnapshotsPagedResponse listTopicSnapshots(
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
- * ApiFuture future =
+ * ApiFuture future =
* topicAdminClient.listTopicSnapshotsPagedCallable().futureCall(request);
* // Do something.
* for (String element : future.get().iterateAll()) {
@@ -1023,7 +1020,7 @@ public final ListTopicSnapshotsPagedResponse listTopicSnapshots(
* while (true) {
* ListTopicSnapshotsResponse response =
* topicAdminClient.listTopicSnapshotsCallable().call(request);
- * for (String element : response.getSnapshotsList()) {
+ * for (String element : response.getResponsesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
@@ -1183,7 +1180,7 @@ public final UnaryCallable deleteTopicCallable() {
* try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
* DetachSubscriptionRequest request =
* DetachSubscriptionRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .build();
* DetachSubscriptionResponse response = topicAdminClient.detachSubscription(request);
* }
@@ -1208,7 +1205,7 @@ public final DetachSubscriptionResponse detachSubscription(DetachSubscriptionReq
* try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
* DetachSubscriptionRequest request =
* DetachSubscriptionRequest.newBuilder()
- * .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ * .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
* .build();
* ApiFuture future =
* topicAdminClient.detachSubscriptionCallable().futureCall(request);
@@ -1600,17 +1597,6 @@ public static ApiFuture createAsync(
private ListTopicSubscriptionsPagedResponse(ListTopicSubscriptionsPage page) {
super(page, ListTopicSubscriptionsFixedSizeCollection.createEmptyCollection());
}
-
- public Iterable iterateAllAsProjectSubscriptionName() {
- return Iterables.transform(
- iterateAll(),
- new Function() {
- @Override
- public ProjectSubscriptionName apply(String arg0) {
- return ProjectSubscriptionName.parse(arg0);
- }
- });
- }
}
public static class ListTopicSubscriptionsPage
@@ -1643,28 +1629,6 @@ public ApiFuture createPageAsync(
ApiFuture futureResponse) {
return super.createPageAsync(context, futureResponse);
}
-
- public Iterable iterateAllAsProjectSubscriptionName() {
- return Iterables.transform(
- iterateAll(),
- new Function() {
- @Override
- public ProjectSubscriptionName apply(String arg0) {
- return ProjectSubscriptionName.parse(arg0);
- }
- });
- }
-
- public Iterable getValuesAsProjectSubscriptionName() {
- return Iterables.transform(
- getValues(),
- new Function() {
- @Override
- public ProjectSubscriptionName apply(String arg0) {
- return ProjectSubscriptionName.parse(arg0);
- }
- });
- }
}
public static class ListTopicSubscriptionsFixedSizeCollection
@@ -1689,17 +1653,6 @@ protected ListTopicSubscriptionsFixedSizeCollection createCollection(
List pages, int collectionSize) {
return new ListTopicSubscriptionsFixedSizeCollection(pages, collectionSize);
}
-
- public Iterable getValuesAsProjectSubscriptionName() {
- return Iterables.transform(
- getValues(),
- new Function() {
- @Override
- public ProjectSubscriptionName apply(String arg0) {
- return ProjectSubscriptionName.parse(arg0);
- }
- });
- }
}
public static class ListTopicSnapshotsPagedResponse
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/package-info.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/package-info.java
index 820341320..128d54247 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/package-info.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/package-info.java
@@ -43,7 +43,7 @@
*
* {@code
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- * ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
* TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
* PushConfig pushConfig = PushConfig.newBuilder().build();
* int ackDeadlineSeconds = 2135351438;
diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java
index 5ccb0793e..2b2e725c1 100644
--- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java
+++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java
@@ -369,7 +369,7 @@ protected GrpcPublisherStub(
callableFactory.createUnaryCallable(
updateTopicTransportSettings, settings.updateTopicSettings(), clientContext);
this.publishCallable =
- callableFactory.createUnaryCallable(
+ callableFactory.createBatchingCallable(
publishTransportSettings, settings.publishSettings(), clientContext);
this.getTopicCallable =
callableFactory.createUnaryCallable(
diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/it/ITPubSubTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/it/ITPubSubTest.java
index 89900c0e4..914a95d8c 100644
--- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/it/ITPubSubTest.java
+++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/it/ITPubSubTest.java
@@ -35,10 +35,10 @@
import com.google.iam.v1.SetIamPolicyRequest;
import com.google.iam.v1.TestIamPermissionsRequest;
import com.google.protobuf.ByteString;
-import com.google.pubsub.v1.ProjectSubscriptionName;
import com.google.pubsub.v1.PubsubMessage;
import com.google.pubsub.v1.PushConfig;
import com.google.pubsub.v1.Subscription;
+import com.google.pubsub.v1.SubscriptionName;
import com.google.pubsub.v1.TopicName;
import java.util.Collections;
import java.util.List;
@@ -94,7 +94,7 @@ private String formatForTest(String resourceName) {
}
private Subscription getSubscription(
- ProjectSubscriptionName subscriptionName,
+ SubscriptionName subscriptionName,
TopicName topicName,
PushConfig pushConfig,
int ackDeadline) {
@@ -151,9 +151,8 @@ public void testVPCPushSubscriber() {
.setProject(projectId)
.setTopic(formatForTest("testing-vpc-push-subscriber-topic"))
.build();
- ProjectSubscriptionName subscriptionName =
- ProjectSubscriptionName.of(
- projectId, formatForTest("testing-vpc-push-subscriber-subscription"));
+ SubscriptionName subscriptionName =
+ SubscriptionName.of(projectId, formatForTest("testing-vpc-push-subscriber-subscription"));
topicAdminClient.createTopic(topicName);
try {
@@ -179,9 +178,8 @@ public void testPublishSubscribe() throws Exception {
.setProject(projectId)
.setTopic(formatForTest("testing-publish-subscribe-topic"))
.build();
- ProjectSubscriptionName subscriptionName =
- ProjectSubscriptionName.of(
- projectId, formatForTest("testing-publish-subscribe-subscription"));
+ SubscriptionName subscriptionName =
+ SubscriptionName.of(projectId, formatForTest("testing-publish-subscribe-subscription"));
topicAdminClient.createTopic(topicName);
@@ -191,7 +189,7 @@ public void testPublishSubscribe() throws Exception {
final BlockingQueue receiveQueue = new LinkedBlockingQueue<>();
Subscriber subscriber =
Subscriber.newBuilder(
- subscriptionName,
+ subscriptionName.toString(),
new MessageReceiver() {
@Override
public void receiveMessage(
diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java
index 00753a6fb..9d53a7554 100644
--- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java
+++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java
@@ -59,8 +59,6 @@
import com.google.pubsub.v1.ModifyAckDeadlineRequest;
import com.google.pubsub.v1.ModifyPushConfigRequest;
import com.google.pubsub.v1.ProjectName;
-import com.google.pubsub.v1.ProjectSnapshotName;
-import com.google.pubsub.v1.ProjectSubscriptionName;
import com.google.pubsub.v1.PullRequest;
import com.google.pubsub.v1.PullResponse;
import com.google.pubsub.v1.PushConfig;
@@ -69,9 +67,11 @@
import com.google.pubsub.v1.SeekRequest;
import com.google.pubsub.v1.SeekResponse;
import com.google.pubsub.v1.Snapshot;
+import com.google.pubsub.v1.SnapshotName;
import com.google.pubsub.v1.StreamingPullRequest;
import com.google.pubsub.v1.StreamingPullResponse;
import com.google.pubsub.v1.Subscription;
+import com.google.pubsub.v1.SubscriptionName;
import com.google.pubsub.v1.TopicName;
import com.google.pubsub.v1.UpdateSnapshotRequest;
import com.google.pubsub.v1.UpdateSubscriptionRequest;
@@ -136,7 +136,7 @@ public void tearDown() throws Exception {
public void createSubscriptionTest() throws Exception {
Subscription expectedResponse =
Subscription.newBuilder()
- .setName(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
@@ -153,7 +153,7 @@ public void createSubscriptionTest() throws Exception {
.build();
mockSubscriber.addResponse(expectedResponse);
- ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
PushConfig pushConfig = PushConfig.newBuilder().build();
int ackDeadlineSeconds = 2135351438;
@@ -182,7 +182,7 @@ public void createSubscriptionExceptionTest() throws Exception {
mockSubscriber.addException(exception);
try {
- ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
PushConfig pushConfig = PushConfig.newBuilder().build();
int ackDeadlineSeconds = 2135351438;
@@ -197,7 +197,7 @@ public void createSubscriptionExceptionTest() throws Exception {
public void createSubscriptionTest2() throws Exception {
Subscription expectedResponse =
Subscription.newBuilder()
- .setName(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
@@ -214,7 +214,7 @@ public void createSubscriptionTest2() throws Exception {
.build();
mockSubscriber.addResponse(expectedResponse);
- ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
String topic = "topic110546223";
PushConfig pushConfig = PushConfig.newBuilder().build();
int ackDeadlineSeconds = 2135351438;
@@ -243,7 +243,7 @@ public void createSubscriptionExceptionTest2() throws Exception {
mockSubscriber.addException(exception);
try {
- ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
String topic = "topic110546223";
PushConfig pushConfig = PushConfig.newBuilder().build();
int ackDeadlineSeconds = 2135351438;
@@ -258,7 +258,7 @@ public void createSubscriptionExceptionTest2() throws Exception {
public void createSubscriptionTest3() throws Exception {
Subscription expectedResponse =
Subscription.newBuilder()
- .setName(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
@@ -319,7 +319,7 @@ public void createSubscriptionExceptionTest3() throws Exception {
public void createSubscriptionTest4() throws Exception {
Subscription expectedResponse =
Subscription.newBuilder()
- .setName(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
@@ -380,7 +380,7 @@ public void createSubscriptionExceptionTest4() throws Exception {
public void getSubscriptionTest() throws Exception {
Subscription expectedResponse =
Subscription.newBuilder()
- .setName(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
@@ -397,8 +397,7 @@ public void getSubscriptionTest() throws Exception {
.build();
mockSubscriber.addResponse(expectedResponse);
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
Subscription actualResponse = client.getSubscription(subscription);
Assert.assertEquals(expectedResponse, actualResponse);
@@ -420,8 +419,7 @@ public void getSubscriptionExceptionTest() throws Exception {
mockSubscriber.addException(exception);
try {
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
client.getSubscription(subscription);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
@@ -433,7 +431,7 @@ public void getSubscriptionExceptionTest() throws Exception {
public void getSubscriptionTest2() throws Exception {
Subscription expectedResponse =
Subscription.newBuilder()
- .setName(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
@@ -484,7 +482,7 @@ public void getSubscriptionExceptionTest2() throws Exception {
public void updateSubscriptionTest() throws Exception {
Subscription expectedResponse =
Subscription.newBuilder()
- .setName(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setPushConfig(PushConfig.newBuilder().build())
.setAckDeadlineSeconds(2135351438)
@@ -633,8 +631,7 @@ public void deleteSubscriptionTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockSubscriber.addResponse(expectedResponse);
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
client.deleteSubscription(subscription);
@@ -655,8 +652,7 @@ public void deleteSubscriptionExceptionTest() throws Exception {
mockSubscriber.addException(exception);
try {
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
client.deleteSubscription(subscription);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
@@ -703,8 +699,7 @@ public void modifyAckDeadlineTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockSubscriber.addResponse(expectedResponse);
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
List ackIds = new ArrayList<>();
int ackDeadlineSeconds = 2135351438;
@@ -729,8 +724,7 @@ public void modifyAckDeadlineExceptionTest() throws Exception {
mockSubscriber.addException(exception);
try {
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
List ackIds = new ArrayList<>();
int ackDeadlineSeconds = 2135351438;
client.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds);
@@ -785,8 +779,7 @@ public void acknowledgeTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockSubscriber.addResponse(expectedResponse);
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
List ackIds = new ArrayList<>();
client.acknowledge(subscription, ackIds);
@@ -809,8 +802,7 @@ public void acknowledgeExceptionTest() throws Exception {
mockSubscriber.addException(exception);
try {
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
List ackIds = new ArrayList<>();
client.acknowledge(subscription, ackIds);
Assert.fail("No exception raised");
@@ -862,8 +854,7 @@ public void pullTest() throws Exception {
PullResponse.newBuilder().addAllReceivedMessages(new ArrayList()).build();
mockSubscriber.addResponse(expectedResponse);
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
int maxMessages = 496131527;
PullResponse actualResponse = client.pull(subscription, maxMessages);
@@ -887,8 +878,7 @@ public void pullExceptionTest() throws Exception {
mockSubscriber.addException(exception);
try {
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
int maxMessages = 496131527;
client.pull(subscription, maxMessages);
Assert.fail("No exception raised");
@@ -942,8 +932,7 @@ public void pullTest3() throws Exception {
PullResponse.newBuilder().addAllReceivedMessages(new ArrayList()).build();
mockSubscriber.addResponse(expectedResponse);
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
boolean returnImmediately = true;
int maxMessages = 496131527;
@@ -969,8 +958,7 @@ public void pullExceptionTest3() throws Exception {
mockSubscriber.addException(exception);
try {
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
boolean returnImmediately = true;
int maxMessages = 496131527;
client.pull(subscription, returnImmediately, maxMessages);
@@ -1033,7 +1021,7 @@ public void streamingPullTest() throws Exception {
mockSubscriber.addResponse(expectedResponse);
StreamingPullRequest request =
StreamingPullRequest.newBuilder()
- .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
.addAllAckIds(new ArrayList())
.addAllModifyDeadlineSeconds(new ArrayList())
.addAllModifyDeadlineAckIds(new ArrayList())
@@ -1064,7 +1052,7 @@ public void streamingPullExceptionTest() throws Exception {
mockSubscriber.addException(exception);
StreamingPullRequest request =
StreamingPullRequest.newBuilder()
- .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
.addAllAckIds(new ArrayList())
.addAllModifyDeadlineSeconds(new ArrayList())
.addAllModifyDeadlineAckIds(new ArrayList())
@@ -1098,8 +1086,7 @@ public void modifyPushConfigTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockSubscriber.addResponse(expectedResponse);
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
PushConfig pushConfig = PushConfig.newBuilder().build();
client.modifyPushConfig(subscription, pushConfig);
@@ -1122,8 +1109,7 @@ public void modifyPushConfigExceptionTest() throws Exception {
mockSubscriber.addException(exception);
try {
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
PushConfig pushConfig = PushConfig.newBuilder().build();
client.modifyPushConfig(subscription, pushConfig);
Assert.fail("No exception raised");
@@ -1173,14 +1159,14 @@ public void modifyPushConfigExceptionTest2() throws Exception {
public void getSnapshotTest() throws Exception {
Snapshot expectedResponse =
Snapshot.newBuilder()
- .setName(ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
+ .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setExpireTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap())
.build();
mockSubscriber.addResponse(expectedResponse);
- ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
Snapshot actualResponse = client.getSnapshot(snapshot);
Assert.assertEquals(expectedResponse, actualResponse);
@@ -1202,7 +1188,7 @@ public void getSnapshotExceptionTest() throws Exception {
mockSubscriber.addException(exception);
try {
- ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
client.getSnapshot(snapshot);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
@@ -1214,7 +1200,7 @@ public void getSnapshotExceptionTest() throws Exception {
public void getSnapshotTest2() throws Exception {
Snapshot expectedResponse =
Snapshot.newBuilder()
- .setName(ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
+ .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setExpireTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap())
@@ -1343,16 +1329,15 @@ public void listSnapshotsExceptionTest2() throws Exception {
public void createSnapshotTest() throws Exception {
Snapshot expectedResponse =
Snapshot.newBuilder()
- .setName(ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
+ .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setExpireTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap())
.build();
mockSubscriber.addResponse(expectedResponse);
- ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
Snapshot actualResponse = client.createSnapshot(name, subscription);
Assert.assertEquals(expectedResponse, actualResponse);
@@ -1375,9 +1360,8 @@ public void createSnapshotExceptionTest() throws Exception {
mockSubscriber.addException(exception);
try {
- ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
client.createSnapshot(name, subscription);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
@@ -1389,14 +1373,14 @@ public void createSnapshotExceptionTest() throws Exception {
public void createSnapshotTest2() throws Exception {
Snapshot expectedResponse =
Snapshot.newBuilder()
- .setName(ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
+ .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setExpireTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap())
.build();
mockSubscriber.addResponse(expectedResponse);
- ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
String subscription = "subscription341203229";
Snapshot actualResponse = client.createSnapshot(name, subscription);
@@ -1420,7 +1404,7 @@ public void createSnapshotExceptionTest2() throws Exception {
mockSubscriber.addException(exception);
try {
- ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
String subscription = "subscription341203229";
client.createSnapshot(name, subscription);
Assert.fail("No exception raised");
@@ -1433,7 +1417,7 @@ public void createSnapshotExceptionTest2() throws Exception {
public void createSnapshotTest3() throws Exception {
Snapshot expectedResponse =
Snapshot.newBuilder()
- .setName(ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
+ .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setExpireTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap())
@@ -1441,8 +1425,7 @@ public void createSnapshotTest3() throws Exception {
mockSubscriber.addResponse(expectedResponse);
String name = "name3373707";
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
Snapshot actualResponse = client.createSnapshot(name, subscription);
Assert.assertEquals(expectedResponse, actualResponse);
@@ -1466,8 +1449,7 @@ public void createSnapshotExceptionTest3() throws Exception {
try {
String name = "name3373707";
- ProjectSubscriptionName subscription =
- ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
client.createSnapshot(name, subscription);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
@@ -1479,7 +1461,7 @@ public void createSnapshotExceptionTest3() throws Exception {
public void createSnapshotTest4() throws Exception {
Snapshot expectedResponse =
Snapshot.newBuilder()
- .setName(ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
+ .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setExpireTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap())
@@ -1523,7 +1505,7 @@ public void createSnapshotExceptionTest4() throws Exception {
public void updateSnapshotTest() throws Exception {
Snapshot expectedResponse =
Snapshot.newBuilder()
- .setName(ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
+ .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString())
.setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString())
.setExpireTime(Timestamp.newBuilder().build())
.putAllLabels(new HashMap())
@@ -1574,7 +1556,7 @@ public void deleteSnapshotTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockSubscriber.addResponse(expectedResponse);
- ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
client.deleteSnapshot(snapshot);
@@ -1595,7 +1577,7 @@ public void deleteSnapshotExceptionTest() throws Exception {
mockSubscriber.addException(exception);
try {
- ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]");
client.deleteSnapshot(snapshot);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
@@ -1644,7 +1626,7 @@ public void seekTest() throws Exception {
SeekRequest request =
SeekRequest.newBuilder()
- .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
.build();
SeekResponse actualResponse = client.seek(request);
@@ -1671,7 +1653,7 @@ public void seekExceptionTest() throws Exception {
try {
SeekRequest request =
SeekRequest.newBuilder()
- .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
.build();
client.seek(request);
Assert.fail("No exception raised");
diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminClientTest.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminClientTest.java
index 4cf5a7502..02d6a5585 100644
--- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminClientTest.java
+++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/TopicAdminClientTest.java
@@ -52,11 +52,11 @@
import com.google.pubsub.v1.ListTopicsResponse;
import com.google.pubsub.v1.MessageStoragePolicy;
import com.google.pubsub.v1.ProjectName;
-import com.google.pubsub.v1.ProjectSubscriptionName;
import com.google.pubsub.v1.PublishRequest;
import com.google.pubsub.v1.PublishResponse;
import com.google.pubsub.v1.PubsubMessage;
import com.google.pubsub.v1.SchemaSettings;
+import com.google.pubsub.v1.SubscriptionName;
import com.google.pubsub.v1.Topic;
import com.google.pubsub.v1.TopicName;
import com.google.pubsub.v1.UpdateTopicRequest;
@@ -764,7 +764,7 @@ public void detachSubscriptionTest() throws Exception {
DetachSubscriptionRequest request =
DetachSubscriptionRequest.newBuilder()
- .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
.build();
DetachSubscriptionResponse actualResponse = client.detachSubscription(request);
@@ -789,7 +789,7 @@ public void detachSubscriptionExceptionTest() throws Exception {
try {
DetachSubscriptionRequest request =
DetachSubscriptionRequest.newBuilder()
- .setSubscription(ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
+ .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString())
.build();
client.detachSubscription(request);
Assert.fail("No exception raised");
diff --git a/grpc-google-cloud-pubsub-v1/pom.xml b/grpc-google-cloud-pubsub-v1/pom.xml
index 742f01e38..068478a89 100644
--- a/grpc-google-cloud-pubsub-v1/pom.xml
+++ b/grpc-google-cloud-pubsub-v1/pom.xml
@@ -4,13 +4,13 @@
4.0.0
com.google.api.grpc
grpc-google-cloud-pubsub-v1
- 1.96.7
+ 1.97.0
grpc-google-cloud-pubsub-v1
GRPC library for grpc-google-cloud-pubsub-v1
com.google.cloud
google-cloud-pubsub-parent
- 1.114.7
+ 1.115.0
diff --git a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublisherGrpc.java b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublisherGrpc.java
index 380561fd8..638e841d7 100644
--- a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublisherGrpc.java
+++ b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublisherGrpc.java
@@ -28,6 +28,7 @@
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: google/pubsub/v1/pubsub.proto")
+@io.grpc.stub.annotations.GrpcGenerated
public final class PublisherGrpc {
private PublisherGrpc() {}
diff --git a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaServiceGrpc.java b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaServiceGrpc.java
index ce5099a57..c8061efe2 100644
--- a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaServiceGrpc.java
+++ b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaServiceGrpc.java
@@ -27,6 +27,7 @@
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: google/pubsub/v1/schema.proto")
+@io.grpc.stub.annotations.GrpcGenerated
public final class SchemaServiceGrpc {
private SchemaServiceGrpc() {}
diff --git a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java
index 295e5e724..de5a11c89 100644
--- a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java
+++ b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java
@@ -29,6 +29,7 @@
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: google/pubsub/v1/pubsub.proto")
+@io.grpc.stub.annotations.GrpcGenerated
public final class SubscriberGrpc {
private SubscriberGrpc() {}
diff --git a/owlbot.py b/owlbot.py
index db3167aba..0d280ad71 100644
--- a/owlbot.py
+++ b/owlbot.py
@@ -402,7 +402,7 @@
* If the subscriber never acknowledges the message, the Pub/Sub system will eventually
* redeliver the message.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
- * @deprecated Use {@link #createSubscription(ProjectSubscriptionName, TopicName, PushConfig, int)} instead.
+ * @deprecated Use {@link #createSubscription(SubscriptionName, TopicName, PushConfig, int)} instead.
*/
@Deprecated
public final Subscription createSubscription(
@@ -419,11 +419,648 @@
.build();
return createSubscription(request);
}
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a subscription to a given topic. See the [resource name rules]
+ * (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already
+ * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns
+ * `NOT_FOUND`.
+ *
+ *
If the name is not provided in the request, the server will assign a random name for this
+ * subscription on the same project as the topic, conforming to the [resource name format]
+ * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in
+ * the returned Subscription object. Note that for REST API requests, you must specify a name in
+ * the request.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString();
+ * PushConfig pushConfig = PushConfig.newBuilder().build();
+ * int ackDeadlineSeconds = 2135351438;
+ * Subscription response =
+ * subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
+ * }
+ * }
+ *
+ * @param name Required. The name of the subscription. It must have the format
+ * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a
+ * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores
+ * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3
+ * and 255 characters in length, and it must not start with `"goog"`.
+ * @param topic Required. The name of the topic from which this subscription is receiving
+ * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be
+ * `_deleted-topic_` if the topic has been deleted.
+ * @param 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.
+ * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits
+ * for the subscriber to acknowledge receipt before resending the message. In the interval
+ * after the message is delivered and before it is acknowledged, it is considered to be
+ * <i>outstanding</i>. During that time period, the message will not be
+ * redelivered (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 `ModifyAckDeadline` with the corresponding
+ * `ack_id` if using non-streaming pull or send the `ack_id` in a
+ * `StreamingModifyAckDeadlineRequest` if using streaming 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.
+ * @deprecated Use {@link #createSubscription(SubscriptionName, String, PushConfig, int)} instead.
+ */
+ @Deprecated
+ public final Subscription createSubscription(
+ ProjectSubscriptionName name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) {
+ Subscription request =
+ Subscription.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setTopic(topic)
+ .setPushConfig(pushConfig)
+ .setAckDeadlineSeconds(ackDeadlineSeconds)
+ .build();
+ return createSubscription(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a subscription to a given topic. See the [resource name rules]
+ * (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already
+ * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns
+ * `NOT_FOUND`.
+ *
+ *
If the name is not provided in the request, the server will assign a random name for this
+ * subscription on the same project as the topic, conforming to the [resource name format]
+ * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in
+ * the returned Subscription object. Note that for REST API requests, you must specify a name in
+ * the request.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
+ * PushConfig pushConfig = PushConfig.newBuilder().build();
+ * int ackDeadlineSeconds = 2135351438;
+ * Subscription response =
+ * subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
+ * }
+ * }
+ *
+ * @param name Required. The name of the subscription. It must have the format
+ * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a
+ * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores
+ * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3
+ * and 255 characters in length, and it must not start with `"goog"`.
+ * @param topic Required. The name of the topic from which this subscription is receiving
+ * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be
+ * `_deleted-topic_` if the topic has been deleted.
+ * @param 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.
+ * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits
+ * for the subscriber to acknowledge receipt before resending the message. In the interval
+ * after the message is delivered and before it is acknowledged, it is considered to be
+ * <i>outstanding</i>. During that time period, the message will not be
+ * redelivered (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 `ModifyAckDeadline` with the corresponding
+ * `ack_id` if using non-streaming pull or send the `ack_id` in a
+ * `StreamingModifyAckDeadlineRequest` if using streaming 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.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #createSubscription(SubscriptionName, TopicName, PushConfig, int)} instead.
+ */
+ @Deprecated
+ public final Subscription createSubscription(
+ ProjectSubscriptionName name,
+ TopicName topic,
+ PushConfig pushConfig,
+ int ackDeadlineSeconds) {
+ Subscription request =
+ Subscription.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setTopic(topic == null ? null : topic.toString())
+ .setPushConfig(pushConfig)
+ .setAckDeadlineSeconds(ackDeadlineSeconds)
+ .build();
+ return createSubscription(request);
+ }
+"""
+
+GET_SUBSCRIPTION_PREVIOUS = r'(\s+public final Subscription getSubscription\(GetSubscriptionRequest request\) {\n\s+return.*\n\s+})'
+
+GET_SUBSCRIPTION = """
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the configuration details of a subscription.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * Subscription response = subscriptionAdminClient.getSubscription(subscription);
+ * }
+ * }
+ *
+ * @param subscription Required. The name of the subscription to get. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #getSubscription(SubscriptionName)} instead.
+ */
+ @Deprecated
+ public final Subscription getSubscription(ProjectSubscriptionName subscription) {
+ GetSubscriptionRequest request =
+ GetSubscriptionRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .build();
+ return getSubscription(request);
+ }
+"""
+
+DELETE_SUBSCRIPTION_PREVIOUS = r'(\s+public final void deleteSubscription\(DeleteSubscriptionRequest request\) {\n\s+deleteSubscription.*\n\s+})'
+
+DELETE_SUBSCRIPTION = """
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes an existing subscription. All messages retained in the subscription are immediately
+ * dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is
+ * deleted, a new one may be created with the same name, but the new one has no association with
+ * the old subscription or its topic unless the same topic is specified.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * subscriptionAdminClient.deleteSubscription(subscription);
+ * }
+ * }
+ *
+ * @param subscription Required. The subscription to delete. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #deleteSubscription(SubscriptionName)} instead.
+ */
+ @Deprecated
+ public final void deleteSubscription(ProjectSubscriptionName subscription) {
+ DeleteSubscriptionRequest request =
+ DeleteSubscriptionRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .build();
+ deleteSubscription(request);
+ }
+"""
+
+MODIFY_ACK_DEADLINE_PREVIOUS = r'(\s+public final void modifyAckDeadline\(ModifyAckDeadlineRequest request\) {\n\s+modifyAckDeadline.*\n\s+})'
+
+MODIFY_ACK_DEADLINE = """
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Modifies the ack deadline for a specific message. This method is useful to indicate that more
+ * time is needed to process a message by the subscriber, or to make the message available for
+ * redelivery if the processing was interrupted. Note that this does not modify the
+ * subscription-level `ackDeadlineSeconds` used for subsequent messages.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * List ackIds = new ArrayList<>();
+ * int ackDeadlineSeconds = 2135351438;
+ * subscriptionAdminClient.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds);
+ * }
+ * }
+ *
+ * @param subscription Required. The name of the subscription. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @param ackIds Required. List of acknowledgment IDs.
+ * @param ackDeadlineSeconds Required. The new ack deadline with respect to the time this request
+ * was sent to the Pub/Sub system. For example, if the value is 10, the new ack deadline will
+ * expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying zero might
+ * immediately make the message available for delivery to another subscriber client. This
+ * typically results in an increase in the rate of message redeliveries (that is, duplicates).
+ * The minimum deadline you can specify is 0 seconds. The maximum deadline you can specify is
+ * 600 seconds (10 minutes).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #modifyAckDeadline(SubscriptionName, List, int)} instead.
+ */
+ @Deprecated
+ final void modifyAckDeadline(
+ ProjectSubscriptionName subscription, List ackIds, int ackDeadlineSeconds) {
+ ModifyAckDeadlineRequest request =
+ ModifyAckDeadlineRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .addAllAckIds(ackIds)
+ .setAckDeadlineSeconds(ackDeadlineSeconds)
+ .build();
+ modifyAckDeadline(request);
+ }
+"""
+
+ACKNOWLEDGE_PREVIOUS = r'(\s+public final void acknowledge\(AcknowledgeRequest request\) {\n\s+acknowledge.*\n\s+})'
+
+ACKNOWLEDGE = """
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The
+ * Pub/Sub system can remove the relevant messages from the subscription.
+ *
+ * Acknowledging a message whose ack deadline has expired may succeed, but such a message may
+ * be redelivered later. Acknowledging a message more than once will not result in an error.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * List ackIds = new ArrayList<>();
+ * subscriptionAdminClient.acknowledge(subscription, ackIds);
+ * }
+ * }
+ *
+ * @param subscription Required. The subscription whose message is being acknowledged. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @param ackIds Required. The acknowledgment ID for the messages being acknowledged that was
+ * returned by the Pub/Sub system in the `Pull` response. Must not be empty.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #acknowledge(SubscriptionName, List)} instead.
+ */
+ @Deprecated
+ public final void acknowledge(ProjectSubscriptionName subscription, List ackIds) {
+ AcknowledgeRequest request =
+ AcknowledgeRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .addAllAckIds(ackIds)
+ .build();
+ acknowledge(request);
+ }
+"""
+
+PULL_PREVIOUS = r'(\s+public final PullResponse pull\(PullRequest request\) {\n\s+return.*\n\s+})'
+
+PULL = """
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many
+ * concurrent pull requests pending for the given subscription.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * int maxMessages = 496131527;
+ * PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages);
+ * }
+ * }
+ *
+ * @param subscription Required. The subscription from which messages should be pulled. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @param maxMessages Required. The maximum number of messages to return for this request. Must be
+ * a positive integer. The Pub/Sub system may return fewer than the number specified.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #pull(SubscriptionName, int)} instead.
+ */
+ @Deprecated
+ public final PullResponse pull(ProjectSubscriptionName subscription, int maxMessages) {
+ PullRequest request =
+ PullRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .setMaxMessages(maxMessages)
+ .build();
+ return pull(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many
+ * concurrent pull requests pending for the given subscription.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * boolean returnImmediately = true;
+ * int maxMessages = 496131527;
+ * PullResponse response =
+ * subscriptionAdminClient.pull(subscription, returnImmediately, maxMessages);
+ * }
+ * }
+ *
+ * @param subscription Required. The subscription from which messages should be pulled. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @param returnImmediately Optional. If this field set to true, the system will respond
+ * immediately even if it there are no messages available to return in the `Pull` response.
+ * Otherwise, the system may wait (for a bounded amount of time) until at least one message is
+ * available, rather than returning no messages. Warning: setting this field to `true` is
+ * discouraged because it adversely impacts the performance of `Pull` operations. We recommend
+ * that users do not set this field.
+ * @param maxMessages Required. The maximum number of messages to return for this request. Must be
+ * a positive integer. The Pub/Sub system may return fewer than the number specified.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #pull(SubscriptionName, boolean, int)} instead.
+ */
+ @Deprecated
+ final PullResponse pull(
+ ProjectSubscriptionName subscription, boolean returnImmediately, int maxMessages) {
+ PullRequest request =
+ PullRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .setReturnImmediately(returnImmediately)
+ .setMaxMessages(maxMessages)
+ .build();
+ return pull(request);
+ }
+"""
+
+MODIFY_PUSH_CONFIG_PREVIOUS = r'(\s+public final void modifyPushConfig\(ModifyPushConfigRequest request\) {\n\s+modifyPushConfig.*\n\s+})'
+
+MODIFY_PUSH_CONFIG = """
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Modifies the `PushConfig` for a specified subscription.
+ *
+ * This may be used to change a push subscription to a pull one (signified by an empty
+ * `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push
+ * subscription. Messages will accumulate for delivery continuously through the call regardless of
+ * changes to the `PushConfig`.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * PushConfig pushConfig = PushConfig.newBuilder().build();
+ * subscriptionAdminClient.modifyPushConfig(subscription, pushConfig);
+ * }
+ * }
+ *
+ * @param subscription Required. The name of the subscription. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @param pushConfig Required. The push configuration for future deliveries.
+ * An empty `pushConfig` indicates that the Pub/Sub system should stop pushing messages
+ * from the given subscription and allow messages to be pulled and acknowledged - effectively
+ * pausing the subscription if `Pull` or `StreamingPull` is not called.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #modifyPushConfig(SubscriptionName, PushConfig)} instead.
+ */
+ @Deprecated
+ public final void modifyPushConfig(ProjectSubscriptionName subscription, PushConfig pushConfig) {
+ ModifyPushConfigRequest request =
+ ModifyPushConfigRequest.newBuilder()
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .setPushConfig(pushConfig)
+ .build();
+ modifyPushConfig(request);
+ }
+"""
+
+CREATE_SNAPSHOT_PREVIOUS = r'(\s+public final Snapshot createSnapshot\(CreateSnapshotRequest request\) {\n\s+return.*\n\s+})'
+
+CREATE_SNAPSHOT = """
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a snapshot from the requested subscription. Snapshots are used in
+ * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to
+ * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of
+ * messages in an existing subscription to the state captured by a snapshot. If the snapshot
+ * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns
+ * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would
+ * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the
+ * `Snapshot.expire_time` field. If the name is not provided in the request, the server will
+ * assign a random name for this snapshot on the same project as the subscription, conforming to
+ * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The
+ * generated name is populated in the returned Snapshot object. Note that for REST API requests,
+ * you must specify a name in the request.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
+ * }
+ * }
+ *
+ * @param name Required. User-provided name for this snapshot. If the name is not provided in the
+ * request, the server will assign a random name for this snapshot on the same project as the
+ * subscription. Note that for REST API requests, you must specify a name. See the <a
+ * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name
+ * rules</a>. Format is `projects/{project}/snapshots/{snap}`.
+ * @param subscription Required. The subscription whose backlog the snapshot retains.
+ * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the
+ * subscription. More precisely, this is defined as the messages in the subscription's backlog
+ * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as
+ * well as: (b) Any messages published to the subscription's topic following the successful
+ * completion of the CreateSnapshot request. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use Use {@link #createSnapshot(SnapshotName, SubscriptionName)} instead.
+ */
+ @Deprecated
+ public final Snapshot createSnapshot(
+ ProjectSnapshotName name, ProjectSubscriptionName subscription) {
+ CreateSnapshotRequest request =
+ CreateSnapshotRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .build();
+ return createSnapshot(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a snapshot from the requested subscription. Snapshots are used in
+ * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to
+ * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of
+ * messages in an existing subscription to the state captured by a snapshot. If the snapshot
+ * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns
+ * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would
+ * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the
+ * `Snapshot.expire_time` field. If the name is not provided in the request, the server will
+ * assign a random name for this snapshot on the same project as the subscription, conforming to
+ * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The
+ * generated name is populated in the returned Snapshot object. Note that for REST API requests,
+ * you must specify a name in the request.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * String name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString();
+ * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
+ * }
+ * }
+ *
+ * @param name Required. User-provided name for this snapshot. If the name is not provided in the
+ * request, the server will assign a random name for this snapshot on the same project as the
+ * subscription. Note that for REST API requests, you must specify a name. See the <a
+ * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name
+ * rules</a>. Format is `projects/{project}/snapshots/{snap}`.
+ * @param subscription Required. The subscription whose backlog the snapshot retains.
+ * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the
+ * subscription. More precisely, this is defined as the messages in the subscription's backlog
+ * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as
+ * well as: (b) Any messages published to the subscription's topic following the successful
+ * completion of the CreateSnapshot request. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use Use {@link #createSnapshot(String, SubscriptionName)} instead.
+ */
+ @Deprecated
+ public final Snapshot createSnapshot(String name, ProjectSubscriptionName subscription) {
+ CreateSnapshotRequest request =
+ CreateSnapshotRequest.newBuilder()
+ .setName(name)
+ .setSubscription(subscription == null ? null : subscription.toString())
+ .build();
+ return createSnapshot(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a snapshot from the requested subscription. Snapshots are used in
+ * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to
+ * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of
+ * messages in an existing subscription to the state captured by a snapshot. If the snapshot
+ * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns
+ * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would
+ * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the
+ * `Snapshot.expire_time` field. If the name is not provided in the request, the server will
+ * assign a random name for this snapshot on the same project as the subscription, conforming to
+ * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The
+ * generated name is populated in the returned Snapshot object. Note that for REST API requests,
+ * you must specify a name in the request.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ * String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString();
+ * Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription);
+ * }
+ * }
+ *
+ * @param name Required. User-provided name for this snapshot. If the name is not provided in the
+ * request, the server will assign a random name for this snapshot on the same project as the
+ * subscription. Note that for REST API requests, you must specify a name. See the <a
+ * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name
+ * rules</a>. Format is `projects/{project}/snapshots/{snap}`.
+ * @param subscription Required. The subscription whose backlog the snapshot retains.
+ * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the
+ * subscription. More precisely, this is defined as the messages in the subscription's backlog
+ * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as
+ * well as: (b) Any messages published to the subscription's topic following the successful
+ * completion of the CreateSnapshot request. Format is
+ * `projects/{project}/subscriptions/{sub}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use Use {@link #createSnapshot(SnapshotName, String)} instead.
+ */
+ @Deprecated
+ public final Snapshot createSnapshot(ProjectSnapshotName name, String subscription) {
+ CreateSnapshotRequest request =
+ CreateSnapshotRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .setSubscription(subscription)
+ .build();
+ return createSnapshot(request);
+ }
+"""
+
+DELETE_SNAPSHOT_PREVIOUS = r'(\s+public final void deleteSnapshot\(DeleteSnapshotRequest request\) {\n\s+deleteSnapshot.*\n\s+})'
+
+DELETE_SNAPSHOT = """
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Removes an existing snapshot. Snapshots are used in [Seek]
+ * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage
+ * message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in
+ * an existing subscription to the state captured by a snapshot. When the snapshot is deleted, all
+ * messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new
+ * one may be created with the same name, but the new one has no association with the old snapshot
+ * or its subscription, unless the same subscription is specified.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ * subscriptionAdminClient.deleteSnapshot(snapshot);
+ * }
+ * }
+ *
+ * @param snapshot Required. The name of the snapshot to delete. Format is
+ * `projects/{project}/snapshots/{snap}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use Use {@link #deleteSnapshot(SnapshotName)} instead.
+ */
+ @Deprecated
+ public final void deleteSnapshot(ProjectSnapshotName snapshot) {
+ DeleteSnapshotRequest request =
+ DeleteSnapshotRequest.newBuilder()
+ .setSnapshot(snapshot == null ? null : snapshot.toString())
+ .build();
+ deleteSnapshot(request);
+ }
+"""
+
+GET_SNAPSHOT_PREVIOUS = r'(\s+public final Snapshot getSnapshot\(GetSnapshotRequest request\) {\n\s+return.*\n\s+})'
+
+GET_SNAPSHOT = """
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the configuration details of a snapshot. Snapshots are used in <a
+ * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which
+ * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment
+ * state of messages in an existing subscription to the state captured by a snapshot.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+ * Snapshot response = subscriptionAdminClient.getSnapshot(snapshot);
+ * }
+ * }
+ *
+ * @param snapshot Required. The name of the snapshot to get. Format is
+ * `projects/{project}/snapshots/{snap}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use Use {@link #getSnapshot(SnapshotName)} instead.
+ */
+ @Deprecated
+ public final Snapshot getSnapshot(ProjectSnapshotName snapshot) {
+ GetSnapshotRequest request =
+ GetSnapshotRequest.newBuilder()
+ .setSnapshot(snapshot == null ? null : snapshot.toString())
+ .build();
+ return getSnapshot(request);
+ }
"""
PACKAGE = 'package com.google.cloud.pubsub.v1;'
IMPORT_PROJECT_TOPIC_NAME = 'import com.google.pubsub.v1.ProjectTopicName;'
+IMPORT_PROJECT_SUBSCRIPTION_NAME = 'import com.google.pubsub.v1.ProjectSubscriptionName;'
+IMPORT_PROJECT_SNAPSHOT_NAME = 'import com.google.pubsub.v1.ProjectSnapshotName;'
for library in s.get_staging_dirs():
# put any special-case replacements here
@@ -504,10 +1141,64 @@
"\g<1>\n\n" + CREATE_SUBSCRIPTION
)
+ s.replace(
+ '**/SubscriptionAdminClient.java',
+ DELETE_SUBSCRIPTION_PREVIOUS,
+ "\g<1>\n\n" + DELETE_SUBSCRIPTION
+ )
+
+ s.replace(
+ '**/SubscriptionAdminClient.java',
+ GET_SUBSCRIPTION_PREVIOUS,
+ "\g<1>\n\n" + GET_SUBSCRIPTION
+ )
+
+ s.replace(
+ '**/SubscriptionAdminClient.java',
+ MODIFY_ACK_DEADLINE_PREVIOUS,
+ "\g<1>\n\n" + MODIFY_ACK_DEADLINE
+ )
+
+ s.replace(
+ '**/SubscriptionAdminClient.java',
+ ACKNOWLEDGE_PREVIOUS,
+ "\g<1>\n\n" + ACKNOWLEDGE
+ )
+
+ s.replace(
+ '**/SubscriptionAdminClient.java',
+ PULL_PREVIOUS,
+ "\g<1>\n\n" + PULL
+ )
+
+ s.replace(
+ '**/SubscriptionAdminClient.java',
+ MODIFY_PUSH_CONFIG_PREVIOUS,
+ "\g<1>\n\n" + MODIFY_PUSH_CONFIG
+ )
+
+ s.replace(
+ '**/SubscriptionAdminClient.java',
+ CREATE_SNAPSHOT_PREVIOUS,
+ "\g<1>\n\n" + CREATE_SNAPSHOT
+ )
+
+ s.replace(
+ '**/SubscriptionAdminClient.java',
+ GET_SNAPSHOT_PREVIOUS,
+ "\g<1>\n\n" + GET_SNAPSHOT
+ )
+
+ s.replace(
+ '**/SubscriptionAdminClient.java',
+ DELETE_SNAPSHOT_PREVIOUS,
+ "\g<1>\n\n" + DELETE_SNAPSHOT
+ )
+
s.replace(
'**/*AdminClient.java',
PACKAGE,
- PACKAGE + '\n\n' + IMPORT_PROJECT_TOPIC_NAME + '\n'
+ PACKAGE + '\n\n' + IMPORT_PROJECT_TOPIC_NAME + '\n' + IMPORT_PROJECT_SUBSCRIPTION_NAME + '\n' + IMPORT_PROJECT_SNAPSHOT_NAME + '\n'
)
s.move(library)
diff --git a/pom.xml b/pom.xml
index a6747916a..eb90896c0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
com.google.cloud
google-cloud-pubsub-parent
pom
- 1.114.7
+ 1.115.0
Google Cloud Pub/Sub Parent
https://github.com/googleapis/java-pubsub
@@ -14,7 +14,7 @@
com.google.cloud
google-cloud-shared-config
- 1.1.0
+ 1.2.2
@@ -61,7 +61,7 @@
com.google.cloud
google-cloud-shared-dependencies
- 2.4.0
+ 2.5.1
pom
import
@@ -69,23 +69,23 @@
com.google.api.grpc
proto-google-cloud-pubsub-v1
- 1.96.7
+ 1.97.0
com.google.api.grpc
grpc-google-cloud-pubsub-v1
- 1.96.7
+ 1.97.0
com.google.cloud
google-cloud-pubsub
- 1.114.7
+ 1.115.0
com.google.errorprone
error_prone_annotations
- 2.9.0
+ 2.10.0
diff --git a/proto-google-cloud-pubsub-v1/pom.xml b/proto-google-cloud-pubsub-v1/pom.xml
index 86dd4f742..3d94f06a8 100644
--- a/proto-google-cloud-pubsub-v1/pom.xml
+++ b/proto-google-cloud-pubsub-v1/pom.xml
@@ -4,13 +4,13 @@
4.0.0
com.google.api.grpc
proto-google-cloud-pubsub-v1
- 1.96.7
+ 1.97.0
proto-google-cloud-pubsub-v1
PROTO library for proto-google-cloud-pubsub-v1
com.google.cloud
google-cloud-pubsub-parent
- 1.114.7
+ 1.115.0
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/AcknowledgeRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/AcknowledgeRequest.java
index 009081161..cf164758b 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/AcknowledgeRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/AcknowledgeRequest.java
@@ -264,7 +264,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_);
}
for (int i = 0; i < ackIds_.size(); i++) {
@@ -279,7 +279,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_);
}
{
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequest.java
index 6c7618f9c..e0a121785 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSchemaRequest.java
@@ -312,13 +312,13 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getParentBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
}
if (schema_ != null) {
output.writeMessage(2, getSchema());
}
- if (!getSchemaIdBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, schemaId_);
}
unknownFields.writeTo(output);
@@ -330,13 +330,13 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getParentBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
}
if (schema_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSchema());
}
- if (!getSchemaIdBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schemaId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, schemaId_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSnapshotRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSnapshotRequest.java
index 00ea43fcd..b37c9f64a 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSnapshotRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/CreateSnapshotRequest.java
@@ -392,10 +392,10 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, subscription_);
}
com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
@@ -409,10 +409,10 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, subscription_);
}
for (java.util.Map.Entry entry :
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeadLetterPolicy.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeadLetterPolicy.java
index 773359cfa..e543187a8 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeadLetterPolicy.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeadLetterPolicy.java
@@ -222,7 +222,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getDeadLetterTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deadLetterTopic_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, deadLetterTopic_);
}
if (maxDeliveryAttempts_ != 0) {
@@ -237,7 +237,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getDeadLetterTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(deadLetterTopic_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, deadLetterTopic_);
}
if (maxDeliveryAttempts_ != 0) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequest.java
index b09de9b8e..69a7b241f 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSchemaRequest.java
@@ -180,7 +180,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
unknownFields.writeTo(output);
@@ -192,7 +192,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSnapshotRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSnapshotRequest.java
index d43936019..b5529abe6 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSnapshotRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSnapshotRequest.java
@@ -180,7 +180,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getSnapshotBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snapshot_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, snapshot_);
}
unknownFields.writeTo(output);
@@ -192,7 +192,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getSnapshotBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snapshot_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, snapshot_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequest.java
index 82bd05b37..e4ca9d30f 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteSubscriptionRequest.java
@@ -180,7 +180,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_);
}
unknownFields.writeTo(output);
@@ -192,7 +192,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteTopicRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteTopicRequest.java
index 68db7a957..db0ba9fbc 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteTopicRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DeleteTopicRequest.java
@@ -180,7 +180,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_);
}
unknownFields.writeTo(output);
@@ -192,7 +192,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionRequest.java
index 6b738acfa..8e56f9e90 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/DetachSubscriptionRequest.java
@@ -180,7 +180,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_);
}
unknownFields.writeTo(output);
@@ -192,7 +192,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequest.java
index d8dd20048..9eff93962 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSchemaRequest.java
@@ -227,7 +227,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
if (view_ != com.google.pubsub.v1.SchemaView.SCHEMA_VIEW_UNSPECIFIED.getNumber()) {
@@ -242,7 +242,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (view_ != com.google.pubsub.v1.SchemaView.SCHEMA_VIEW_UNSPECIFIED.getNumber()) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSnapshotRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSnapshotRequest.java
index ee75fc7d3..2cdf4abfe 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSnapshotRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSnapshotRequest.java
@@ -180,7 +180,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getSnapshotBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snapshot_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, snapshot_);
}
unknownFields.writeTo(output);
@@ -192,7 +192,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getSnapshotBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(snapshot_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, snapshot_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSubscriptionRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSubscriptionRequest.java
index 7aed4b01a..1c9992ee8 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSubscriptionRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetSubscriptionRequest.java
@@ -180,7 +180,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_);
}
unknownFields.writeTo(output);
@@ -192,7 +192,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetTopicRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetTopicRequest.java
index acf62a7f7..0d3e779c5 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetTopicRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/GetTopicRequest.java
@@ -180,7 +180,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_);
}
unknownFields.writeTo(output);
@@ -192,7 +192,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequest.java
index 95cf9ecab..0c8e4883d 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasRequest.java
@@ -311,7 +311,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getParentBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
}
if (view_ != com.google.pubsub.v1.SchemaView.SCHEMA_VIEW_UNSPECIFIED.getNumber()) {
@@ -320,7 +320,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (pageSize_ != 0) {
output.writeInt32(3, pageSize_);
}
- if (!getPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_);
}
unknownFields.writeTo(output);
@@ -332,7 +332,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getParentBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
}
if (view_ != com.google.pubsub.v1.SchemaView.SCHEMA_VIEW_UNSPECIFIED.getNumber()) {
@@ -341,7 +341,7 @@ public int getSerializedSize() {
if (pageSize_ != 0) {
size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_);
}
- if (!getPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponse.java
index ea77ff15a..27f189db1 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponse.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSchemasResponse.java
@@ -262,7 +262,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
for (int i = 0; i < schemas_.size(); i++) {
output.writeMessage(1, schemas_.get(i));
}
- if (!getNextPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
}
unknownFields.writeTo(output);
@@ -277,7 +277,7 @@ public int getSerializedSize() {
for (int i = 0; i < schemas_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, schemas_.get(i));
}
- if (!getNextPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsRequest.java
index 72ce020e1..6958265a6 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsRequest.java
@@ -264,13 +264,13 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getProjectBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, project_);
}
if (pageSize_ != 0) {
output.writeInt32(2, pageSize_);
}
- if (!getPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_);
}
unknownFields.writeTo(output);
@@ -282,13 +282,13 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getProjectBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, project_);
}
if (pageSize_ != 0) {
size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_);
}
- if (!getPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsResponse.java
index e355e42f6..d7747b6dd 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsResponse.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSnapshotsResponse.java
@@ -263,7 +263,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
for (int i = 0; i < snapshots_.size(); i++) {
output.writeMessage(1, snapshots_.get(i));
}
- if (!getNextPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
}
unknownFields.writeTo(output);
@@ -278,7 +278,7 @@ public int getSerializedSize() {
for (int i = 0; i < snapshots_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, snapshots_.get(i));
}
- if (!getNextPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequest.java
index a1484c696..7599fbf28 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsRequest.java
@@ -264,13 +264,13 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getProjectBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, project_);
}
if (pageSize_ != 0) {
output.writeInt32(2, pageSize_);
}
- if (!getPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_);
}
unknownFields.writeTo(output);
@@ -282,13 +282,13 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getProjectBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, project_);
}
if (pageSize_ != 0) {
size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_);
}
- if (!getPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponse.java
index 03b7ba951..614895dde 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponse.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListSubscriptionsResponse.java
@@ -265,7 +265,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
for (int i = 0; i < subscriptions_.size(); i++) {
output.writeMessage(1, subscriptions_.get(i));
}
- if (!getNextPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
}
unknownFields.writeTo(output);
@@ -280,7 +280,7 @@ public int getSerializedSize() {
for (int i = 0; i < subscriptions_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, subscriptions_.get(i));
}
- if (!getNextPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsRequest.java
index 2edd5bdc8..9ba97ba5a 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsRequest.java
@@ -264,13 +264,13 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_);
}
if (pageSize_ != 0) {
output.writeInt32(2, pageSize_);
}
- if (!getPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_);
}
unknownFields.writeTo(output);
@@ -282,13 +282,13 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_);
}
if (pageSize_ != 0) {
size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_);
}
- if (!getPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsResponse.java
index a19c8778d..c098cc39a 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsResponse.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSnapshotsResponse.java
@@ -257,7 +257,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
for (int i = 0; i < snapshots_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, snapshots_.getRaw(i));
}
- if (!getNextPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
}
unknownFields.writeTo(output);
@@ -277,7 +277,7 @@ public int getSerializedSize() {
size += dataSize;
size += 1 * getSnapshotsList().size();
}
- if (!getNextPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequest.java
index 2bd00bee6..d8a5d96fd 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsRequest.java
@@ -264,13 +264,13 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_);
}
if (pageSize_ != 0) {
output.writeInt32(2, pageSize_);
}
- if (!getPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_);
}
unknownFields.writeTo(output);
@@ -282,13 +282,13 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_);
}
if (pageSize_ != 0) {
size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_);
}
- if (!getPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponse.java
index 303bd86a4..c81e4fe62 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponse.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicSubscriptionsResponse.java
@@ -258,7 +258,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
for (int i = 0; i < subscriptions_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscriptions_.getRaw(i));
}
- if (!getNextPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
}
unknownFields.writeTo(output);
@@ -278,7 +278,7 @@ public int getSerializedSize() {
size += dataSize;
size += 1 * getSubscriptionsList().size();
}
- if (!getNextPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsRequest.java
index b6660177d..17f59fd63 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsRequest.java
@@ -264,13 +264,13 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getProjectBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, project_);
}
if (pageSize_ != 0) {
output.writeInt32(2, pageSize_);
}
- if (!getPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_);
}
unknownFields.writeTo(output);
@@ -282,13 +282,13 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getProjectBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(project_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, project_);
}
if (pageSize_ != 0) {
size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_);
}
- if (!getPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsResponse.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsResponse.java
index 6e42dbb0e..0af6dd447 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsResponse.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ListTopicsResponse.java
@@ -262,7 +262,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
for (int i = 0; i < topics_.size(); i++) {
output.writeMessage(1, topics_.get(i));
}
- if (!getNextPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_);
}
unknownFields.writeTo(output);
@@ -277,7 +277,7 @@ public int getSerializedSize() {
for (int i = 0; i < topics_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, topics_.get(i));
}
- if (!getNextPageTokenBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequest.java
index a3e24dce8..30831833d 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyAckDeadlineRequest.java
@@ -286,7 +286,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_);
}
if (ackDeadlineSeconds_ != 0) {
@@ -304,7 +304,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_);
}
if (ackDeadlineSeconds_ != 0) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequest.java
index 0ee605fad..8833432d8 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ModifyPushConfigRequest.java
@@ -256,7 +256,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_);
}
if (pushConfig_ != null) {
@@ -271,7 +271,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_);
}
if (pushConfig_ != null) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishRequest.java
index f255ee55b..3c1a2c428 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PublishRequest.java
@@ -275,7 +275,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_);
}
for (int i = 0; i < messages_.size(); i++) {
@@ -290,7 +290,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_);
}
for (int i = 0; i < messages_.size(); i++) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubMessage.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubMessage.java
index 297538098..bda025a24 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubMessage.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubMessage.java
@@ -485,13 +485,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
}
com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 2);
- if (!getMessageIdBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(messageId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, messageId_);
}
if (publishTime_ != null) {
output.writeMessage(4, getPublishTime());
}
- if (!getOrderingKeyBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderingKey_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderingKey_);
}
unknownFields.writeTo(output);
@@ -516,13 +516,13 @@ public int getSerializedSize() {
.build();
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, attributes__);
}
- if (!getMessageIdBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(messageId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, messageId_);
}
if (publishTime_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPublishTime());
}
- if (!getOrderingKeyBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderingKey_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderingKey_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullRequest.java
index 4c59e15a5..097ffd48d 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PullRequest.java
@@ -234,7 +234,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_);
}
if (returnImmediately_ != false) {
@@ -252,7 +252,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_);
}
if (returnImmediately_ != false) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfig.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfig.java
index 12614a75b..74e82b909 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfig.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfig.java
@@ -460,10 +460,10 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getServiceAccountEmailBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, serviceAccountEmail_);
}
- if (!getAudienceBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audience_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, audience_);
}
unknownFields.writeTo(output);
@@ -475,10 +475,10 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getServiceAccountEmailBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, serviceAccountEmail_);
}
- if (!getAudienceBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audience_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, audience_);
}
size += unknownFields.getSerializedSize();
@@ -1415,7 +1415,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getPushEndpointBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pushEndpoint_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pushEndpoint_);
}
com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
@@ -1432,7 +1432,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getPushEndpointBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pushEndpoint_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pushEndpoint_);
}
for (java.util.Map.Entry entry :
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessage.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessage.java
index 38e472e7a..84c1a8242 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessage.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessage.java
@@ -269,7 +269,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getAckIdBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ackId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ackId_);
}
if (message_ != null) {
@@ -287,7 +287,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getAckIdBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ackId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ackId_);
}
if (message_ != null) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Schema.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Schema.java
index cd8adc77b..c157eb4ba 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Schema.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Schema.java
@@ -435,13 +435,13 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
if (type_ != com.google.pubsub.v1.Schema.Type.TYPE_UNSPECIFIED.getNumber()) {
output.writeEnum(2, type_);
}
- if (!getDefinitionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(definition_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, definition_);
}
unknownFields.writeTo(output);
@@ -453,13 +453,13 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (type_ != com.google.pubsub.v1.Schema.Type.TYPE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_);
}
- if (!getDefinitionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(definition_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, definition_);
}
size += unknownFields.getSerializedSize();
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettings.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettings.java
index bca71d432..ee21a2fe6 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettings.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaSettings.java
@@ -227,7 +227,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getSchemaBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schema_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, schema_);
}
if (encoding_ != com.google.pubsub.v1.Encoding.ENCODING_UNSPECIFIED.getNumber()) {
@@ -242,7 +242,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getSchemaBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(schema_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, schema_);
}
if (encoding_ != com.google.pubsub.v1.Encoding.ENCODING_UNSPECIFIED.getNumber()) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekRequest.java
index f9d6cc75d..a10126f4a 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SeekRequest.java
@@ -402,7 +402,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_);
}
if (targetCase_ == 2) {
@@ -420,7 +420,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_);
}
if (targetCase_ == 2) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Snapshot.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Snapshot.java
index 7097a40b5..765007468 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Snapshot.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Snapshot.java
@@ -448,10 +448,10 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, topic_);
}
if (expireTime_ != null) {
@@ -468,10 +468,10 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, topic_);
}
if (expireTime_ != null) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullRequest.java
index d0c8d9a3f..a5b507540 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/StreamingPullRequest.java
@@ -631,7 +631,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
getSerializedSize();
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_);
}
for (int i = 0; i < ackIds_.size(); i++) {
@@ -651,7 +651,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (streamAckDeadlineSeconds_ != 0) {
output.writeInt32(5, streamAckDeadlineSeconds_);
}
- if (!getClientIdBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, clientId_);
}
if (maxOutstandingMessages_ != 0L) {
@@ -669,7 +669,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getSubscriptionBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subscription_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subscription_);
}
{
@@ -705,7 +705,7 @@ public int getSerializedSize() {
if (streamAckDeadlineSeconds_ != 0) {
size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, streamAckDeadlineSeconds_);
}
- if (!getClientIdBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, clientId_);
}
if (maxOutstandingMessages_ != 0L) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Subscription.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Subscription.java
index a4e0edaa8..6b45b5f6c 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Subscription.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Subscription.java
@@ -1029,10 +1029,10 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, topic_);
}
if (pushConfig_ != null) {
@@ -1055,7 +1055,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (expirationPolicy_ != null) {
output.writeMessage(11, getExpirationPolicy());
}
- if (!getFilterBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 12, filter_);
}
if (deadLetterPolicy_ != null) {
@@ -1079,10 +1079,10 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
- if (!getTopicBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, topic_);
}
if (pushConfig_ != null) {
@@ -1115,7 +1115,7 @@ public int getSerializedSize() {
if (expirationPolicy_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getExpirationPolicy());
}
- if (!getFilterBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, filter_);
}
if (deadLetterPolicy_ != null) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Topic.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Topic.java
index f2d2bb19f..1682c2329 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Topic.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/Topic.java
@@ -612,7 +612,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
@@ -620,7 +620,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (messageStoragePolicy_ != null) {
output.writeMessage(3, getMessageStoragePolicy());
}
- if (!getKmsKeyNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, kmsKeyName_);
}
if (schemaSettings_ != null) {
@@ -641,7 +641,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
for (java.util.Map.Entry entry :
@@ -658,7 +658,7 @@ public int getSerializedSize() {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMessageStoragePolicy());
}
- if (!getKmsKeyNameBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, kmsKeyName_);
}
if (schemaSettings_ != null) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequest.java
index d1a77c968..c5bdcde47 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateMessageRequest.java
@@ -440,7 +440,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getParentBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
}
if (schemaSpecCase_ == 2) {
@@ -464,7 +464,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getParentBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
}
if (schemaSpecCase_ == 2) {
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequest.java
index 631fca4ef..0e62b8478 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequest.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ValidateSchemaRequest.java
@@ -240,7 +240,7 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
- if (!getParentBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
}
if (schema_ != null) {
@@ -255,7 +255,7 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (!getParentBytes().isEmpty()) {
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
}
if (schema_ != null) {
diff --git a/samples/install-without-bom/pom.xml b/samples/install-without-bom/pom.xml
index d377c06f1..90237c256 100644
--- a/samples/install-without-bom/pom.xml
+++ b/samples/install-without-bom/pom.xml
@@ -44,14 +44,14 @@
com.google.cloud
google-cloud-pubsub
- 1.114.6
+ 1.114.7
org.apache.avro
avro
- 1.10.2
+ 1.11.0
compile
@@ -75,12 +75,12 @@
com.google.protobuf
protobuf-java-util
- 3.18.1
+ 3.19.1
com.google.cloud
google-cloud-core
- 2.2.0
+ 2.3.3
tests
diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml
index 4a7e01da1..d6ba900f6 100644
--- a/samples/snapshot/pom.xml
+++ b/samples/snapshot/pom.xml
@@ -43,14 +43,14 @@
com.google.cloud
google-cloud-pubsub
- 1.114.7
+ 1.115.0
org.apache.avro
avro
- 1.10.2
+ 1.11.0
compile
@@ -61,7 +61,7 @@
com.google.protobuf
protobuf-java-util
- 3.18.1
+ 3.19.1
@@ -79,7 +79,7 @@
com.google.cloud
google-cloud-core
- 2.2.0
+ 2.3.3
tests
diff --git a/samples/snippets/pom.xml b/samples/snippets/pom.xml
index 34d38f581..e93ed15c9 100644
--- a/samples/snippets/pom.xml
+++ b/samples/snippets/pom.xml
@@ -45,7 +45,7 @@
com.google.cloud
libraries-bom
- 23.1.0
+ 24.0.0
pom
import
@@ -62,7 +62,7 @@
org.apache.avro
avro
- 1.10.2
+ 1.11.0
org.xerial.snappy
@@ -72,7 +72,7 @@
com.google.protobuf
protobuf-java-util
- 3.18.1
+ 3.19.1
@@ -90,7 +90,7 @@
com.google.cloud
google-cloud-core
- 2.2.0
+ 2.3.3
tests
diff --git a/samples/snippets/src/main/java/pubsub/CreatePullSubscriptionExample.java b/samples/snippets/src/main/java/pubsub/CreatePullSubscriptionExample.java
index b8ba1ae68..e58fd621e 100644
--- a/samples/snippets/src/main/java/pubsub/CreatePullSubscriptionExample.java
+++ b/samples/snippets/src/main/java/pubsub/CreatePullSubscriptionExample.java
@@ -19,9 +19,9 @@
// [START pubsub_create_pull_subscription]
import com.google.cloud.pubsub.v1.SubscriptionAdminClient;
-import com.google.pubsub.v1.ProjectSubscriptionName;
import com.google.pubsub.v1.PushConfig;
import com.google.pubsub.v1.Subscription;
+import com.google.pubsub.v1.SubscriptionName;
import com.google.pubsub.v1.TopicName;
import java.io.IOException;
@@ -39,8 +39,7 @@ public static void createPullSubscriptionExample(
String projectId, String subscriptionId, String topicId) throws IOException {
try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
TopicName topicName = TopicName.of(projectId, topicId);
- ProjectSubscriptionName subscriptionName =
- ProjectSubscriptionName.of(projectId, subscriptionId);
+ SubscriptionName subscriptionName = SubscriptionName.of(projectId, subscriptionId);
// Create a pull subscription with default acknowledgement deadline of 10 seconds.
// Messages not successfully acknowledged within 10 seconds will get resent by the server.
Subscription subscription =
diff --git a/samples/snippets/src/main/java/pubsub/CreatePushSubscriptionExample.java b/samples/snippets/src/main/java/pubsub/CreatePushSubscriptionExample.java
index db0175b07..b77795290 100644
--- a/samples/snippets/src/main/java/pubsub/CreatePushSubscriptionExample.java
+++ b/samples/snippets/src/main/java/pubsub/CreatePushSubscriptionExample.java
@@ -19,9 +19,9 @@
// [START pubsub_create_push_subscription]
import com.google.cloud.pubsub.v1.SubscriptionAdminClient;
-import com.google.pubsub.v1.ProjectSubscriptionName;
import com.google.pubsub.v1.PushConfig;
import com.google.pubsub.v1.Subscription;
+import com.google.pubsub.v1.SubscriptionName;
import com.google.pubsub.v1.TopicName;
import java.io.IOException;
@@ -41,8 +41,7 @@ public static void createPushSubscriptionExample(
throws IOException {
try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
TopicName topicName = TopicName.of(projectId, topicId);
- ProjectSubscriptionName subscriptionName =
- ProjectSubscriptionName.of(projectId, subscriptionId);
+ SubscriptionName subscriptionName = SubscriptionName.of(projectId, subscriptionId);
PushConfig pushConfig = PushConfig.newBuilder().setPushEndpoint(pushEndpoint).build();
// Create a push subscription with default acknowledgement deadline of 10 seconds.
diff --git a/samples/snippets/src/main/java/pubsub/DeleteSubscriptionExample.java b/samples/snippets/src/main/java/pubsub/DeleteSubscriptionExample.java
index 28d683f1f..0142ba2c3 100644
--- a/samples/snippets/src/main/java/pubsub/DeleteSubscriptionExample.java
+++ b/samples/snippets/src/main/java/pubsub/DeleteSubscriptionExample.java
@@ -20,7 +20,7 @@
import com.google.api.gax.rpc.NotFoundException;
import com.google.cloud.pubsub.v1.SubscriptionAdminClient;
-import com.google.pubsub.v1.ProjectSubscriptionName;
+import com.google.pubsub.v1.SubscriptionName;
import java.io.IOException;
public class DeleteSubscriptionExample {
@@ -36,8 +36,7 @@ public static void main(String... args) throws Exception {
public static void deleteSubscriptionExample(String projectId, String subscriptionId)
throws IOException {
try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- ProjectSubscriptionName subscriptionName =
- ProjectSubscriptionName.of(projectId, subscriptionId);
+ SubscriptionName subscriptionName = SubscriptionName.of(projectId, subscriptionId);
try {
subscriptionAdminClient.deleteSubscription(subscriptionName);
System.out.println("Deleted subscription.");
diff --git a/samples/snippets/src/main/java/pubsub/DetachSubscriptionExample.java b/samples/snippets/src/main/java/pubsub/DetachSubscriptionExample.java
index 88ebb8e05..b414563c2 100644
--- a/samples/snippets/src/main/java/pubsub/DetachSubscriptionExample.java
+++ b/samples/snippets/src/main/java/pubsub/DetachSubscriptionExample.java
@@ -20,8 +20,8 @@
import com.google.cloud.pubsub.v1.SubscriptionAdminClient;
import com.google.cloud.pubsub.v1.TopicAdminClient;
import com.google.pubsub.v1.DetachSubscriptionRequest;
-import com.google.pubsub.v1.ProjectSubscriptionName;
import com.google.pubsub.v1.Subscription;
+import com.google.pubsub.v1.SubscriptionName;
import java.io.IOException;
public class DetachSubscriptionExample {
@@ -36,8 +36,7 @@ public static void main(String... args) throws Exception {
public static void detachSubscriptionExample(String projectId, String subscriptionId)
throws IOException {
- ProjectSubscriptionName subscriptionName =
- ProjectSubscriptionName.of(projectId, subscriptionId);
+ SubscriptionName subscriptionName = SubscriptionName.of(projectId, subscriptionId);
try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
topicAdminClient.detachSubscription(
diff --git a/samples/snippets/src/main/java/pubsub/PublishWithOrderingKeys.java b/samples/snippets/src/main/java/pubsub/PublishWithOrderingKeys.java
index d199e7ff8..e1509db5a 100644
--- a/samples/snippets/src/main/java/pubsub/PublishWithOrderingKeys.java
+++ b/samples/snippets/src/main/java/pubsub/PublishWithOrderingKeys.java
@@ -27,7 +27,7 @@
import com.google.pubsub.v1.PubsubMessage;
import com.google.pubsub.v1.TopicName;
import java.io.IOException;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@@ -54,7 +54,7 @@ public static void publishWithOrderingKeysExample(String projectId, String topic
.build();
try {
- Map messages = new HashMap();
+ Map messages = new LinkedHashMap();
messages.put("message1", "key1");
messages.put("message2", "key2");
messages.put("message3", "key1");
diff --git a/samples/snippets/src/main/java/pubsub/ResumePublishWithOrderingKeys.java b/samples/snippets/src/main/java/pubsub/ResumePublishWithOrderingKeys.java
index 06489637d..ce5e91754 100644
--- a/samples/snippets/src/main/java/pubsub/ResumePublishWithOrderingKeys.java
+++ b/samples/snippets/src/main/java/pubsub/ResumePublishWithOrderingKeys.java
@@ -27,7 +27,7 @@
import com.google.pubsub.v1.PubsubMessage;
import com.google.pubsub.v1.TopicName;
import java.io.IOException;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@@ -52,7 +52,7 @@ public static void resumePublishWithOrderingKeysExample(String projectId, String
.build();
try {
- Map messages = new HashMap();
+ Map messages = new LinkedHashMap();
messages.put("message1", "key1");
messages.put("message2", "key2");
messages.put("message3", "key1");
diff --git a/samples/snippets/src/main/java/pubsub/UpdateDeadLetterPolicyExample.java b/samples/snippets/src/main/java/pubsub/UpdateDeadLetterPolicyExample.java
index c8d7babee..d2946e8f3 100644
--- a/samples/snippets/src/main/java/pubsub/UpdateDeadLetterPolicyExample.java
+++ b/samples/snippets/src/main/java/pubsub/UpdateDeadLetterPolicyExample.java
@@ -21,8 +21,8 @@
import com.google.cloud.pubsub.v1.SubscriptionAdminClient;
import com.google.protobuf.FieldMask;
import com.google.pubsub.v1.DeadLetterPolicy;
-import com.google.pubsub.v1.ProjectSubscriptionName;
import com.google.pubsub.v1.Subscription;
+import com.google.pubsub.v1.SubscriptionName;
import com.google.pubsub.v1.TopicName;
import com.google.pubsub.v1.UpdateSubscriptionRequest;
import java.io.IOException;
@@ -48,8 +48,7 @@ public static void updateDeadLetterPolicyExample(
throws IOException {
try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- ProjectSubscriptionName subscriptionName =
- ProjectSubscriptionName.of(projectId, subscriptionId);
+ SubscriptionName subscriptionName = SubscriptionName.of(projectId, subscriptionId);
System.out.println(
"Before: " + subscriptionAdminClient.getSubscription(subscriptionName).getAllFields());
diff --git a/samples/snippets/src/main/java/pubsub/UpdatePushConfigurationExample.java b/samples/snippets/src/main/java/pubsub/UpdatePushConfigurationExample.java
index ae674be74..d4a583e92 100644
--- a/samples/snippets/src/main/java/pubsub/UpdatePushConfigurationExample.java
+++ b/samples/snippets/src/main/java/pubsub/UpdatePushConfigurationExample.java
@@ -19,9 +19,9 @@
// [START pubsub_update_push_configuration]
import com.google.cloud.pubsub.v1.SubscriptionAdminClient;
-import com.google.pubsub.v1.ProjectSubscriptionName;
import com.google.pubsub.v1.PushConfig;
import com.google.pubsub.v1.Subscription;
+import com.google.pubsub.v1.SubscriptionName;
import java.io.IOException;
public class UpdatePushConfigurationExample {
@@ -37,8 +37,7 @@ public static void main(String... args) throws Exception {
public static void updatePushConfigurationExample(
String projectId, String subscriptionId, String pushEndpoint) throws IOException {
try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
- ProjectSubscriptionName subscriptionName =
- ProjectSubscriptionName.of(projectId, subscriptionId);
+ SubscriptionName subscriptionName = SubscriptionName.of(projectId, subscriptionId);
PushConfig pushConfig = PushConfig.newBuilder().setPushEndpoint(pushEndpoint).build();
subscriptionAdminClient.modifyPushConfig(subscriptionName, pushConfig);
Subscription subscription = subscriptionAdminClient.getSubscription(subscriptionName);
diff --git a/samples/snippets/src/test/java/pubsub/AdminIT.java b/samples/snippets/src/test/java/pubsub/AdminIT.java
index 1d198044d..59bb4377d 100644
--- a/samples/snippets/src/test/java/pubsub/AdminIT.java
+++ b/samples/snippets/src/test/java/pubsub/AdminIT.java
@@ -22,8 +22,8 @@
import com.google.api.gax.rpc.NotFoundException;
import com.google.cloud.pubsub.v1.SubscriptionAdminClient;
import com.google.cloud.pubsub.v1.TopicAdminClient;
-import com.google.pubsub.v1.ProjectSubscriptionName;
-import com.google.pubsub.v1.ProjectTopicName;
+import com.google.pubsub.v1.SubscriptionName;
+import com.google.pubsub.v1.TopicName;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.UUID;
@@ -46,13 +46,13 @@ public class AdminIT {
private static final String orderedSubscriptionId = "iam-ordered-subscription-" + _suffix;
private static final String pushEndpoint = "https://my-test-project.appspot.com/push";
- private static final ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId);
- private static final ProjectSubscriptionName pullSubscriptionName =
- ProjectSubscriptionName.of(projectId, pullSubscriptionId);
- private static final ProjectSubscriptionName pushSubscriptionName =
- ProjectSubscriptionName.of(projectId, pushSubscriptionId);
- private static final ProjectSubscriptionName orderedSubscriptionName =
- ProjectSubscriptionName.of(projectId, orderedSubscriptionId);
+ private static final TopicName topicName = TopicName.of(projectId, topicId);
+ private static final SubscriptionName pullSubscriptionName =
+ SubscriptionName.of(projectId, pullSubscriptionId);
+ private static final SubscriptionName pushSubscriptionName =
+ SubscriptionName.of(projectId, pushSubscriptionId);
+ private static final SubscriptionName orderedSubscriptionName =
+ SubscriptionName.of(projectId, orderedSubscriptionId);
private static void requireEnvVar(String varName) {
assertNotNull(
diff --git a/samples/snippets/src/test/java/pubsub/DeadLetterQueueIT.java b/samples/snippets/src/test/java/pubsub/DeadLetterQueueIT.java
index fd9e72a33..8a97d25f5 100644
--- a/samples/snippets/src/test/java/pubsub/DeadLetterQueueIT.java
+++ b/samples/snippets/src/test/java/pubsub/DeadLetterQueueIT.java
@@ -24,10 +24,10 @@
import com.google.cloud.pubsub.v1.TopicAdminClient;
import com.google.cloud.testing.junit4.MultipleAttemptsRule;
import com.google.protobuf.ByteString;
-import com.google.pubsub.v1.ProjectSubscriptionName;
-import com.google.pubsub.v1.ProjectTopicName;
import com.google.pubsub.v1.PubsubMessage;
+import com.google.pubsub.v1.SubscriptionName;
import com.google.pubsub.v1.Topic;
+import com.google.pubsub.v1.TopicName;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.UUID;
@@ -48,9 +48,9 @@ public class DeadLetterQueueIT {
private static String topicId;
private static String subscriptionId;
private static String deadLetterTopicId;
- private static ProjectTopicName topicName;
- private static ProjectTopicName deadLetterTopicName;
- private static ProjectSubscriptionName subscriptionName;
+ private static TopicName topicName;
+ private static TopicName deadLetterTopicName;
+ private static SubscriptionName subscriptionName;
private static void requireEnvVar(String varName) {
assertNotNull(
@@ -60,7 +60,7 @@ private static void requireEnvVar(String varName) {
// Helper function to publish a message.
private static void publishSomeMessages() throws Exception {
- ProjectTopicName topicName = ProjectTopicName.of(projectId, topicId);
+ TopicName topicName = TopicName.of(projectId, topicId);
Publisher publisher = Publisher.newBuilder(topicName).build();
ByteString data = ByteString.copyFromUtf8("Hello");
PubsubMessage pubsubMessage = PubsubMessage.newBuilder().setData(data).build();
@@ -77,9 +77,9 @@ public static void checkRequirements() {
topicId = "topic-" + _suffix;
subscriptionId = "subscription-" + _suffix;
deadLetterTopicId = "topic-dlq-" + _suffix;
- topicName = ProjectTopicName.of(projectId, topicId);
- deadLetterTopicName = ProjectTopicName.of(projectId, deadLetterTopicId);
- subscriptionName = ProjectSubscriptionName.of(projectId, subscriptionId);
+ topicName = TopicName.of(projectId, topicId);
+ deadLetterTopicName = TopicName.of(projectId, deadLetterTopicId);
+ subscriptionName = SubscriptionName.of(projectId, subscriptionId);
}
@Before
diff --git a/versions.txt b/versions.txt
index c6c187266..75deb1c0a 100644
--- a/versions.txt
+++ b/versions.txt
@@ -1,6 +1,6 @@
# Format:
# module:released-version:current-version
-google-cloud-pubsub:1.114.7:1.114.7
-grpc-google-cloud-pubsub-v1:1.96.7:1.96.7
-proto-google-cloud-pubsub-v1:1.96.7:1.96.7
+google-cloud-pubsub:1.115.0:1.115.0
+grpc-google-cloud-pubsub-v1:1.97.0:1.97.0
+proto-google-cloud-pubsub-v1:1.97.0:1.97.0