From 4558c3430901cdaec12a43e06ea4fafaa01c08e0 Mon Sep 17 00:00:00 2001 From: Hanzhen Yi Date: Wed, 1 Apr 2020 13:42:12 -0700 Subject: [PATCH] feat: add TopicName (#113) * [CHANGE ME] Re-generated to pick up changes in the API or client library generator. * regenerate * trigger kokoro * debug * trigger kokoro * remove debugging * Remove sample poms * add deprecation info * add back documentation * remove samples Co-authored-by: yoshi-automation --- .github/PULL_REQUEST_TEMPLATE.md | 8 +- .kokoro/build.sh | 19 +- .kokoro/common.sh | 44 + .kokoro/dependencies.sh | 15 +- .kokoro/linkage-monitor.sh | 22 +- .../pubsub/v1/SubscriptionAdminClient.java | 222 ++-- .../cloud/pubsub/v1/TopicAdminClient.java | 281 +++-- .../google/cloud/pubsub/v1/package-info.java | 4 +- .../google/cloud/pubsub/it/ITPubSubTest.java | 1 - .../v1/SubscriptionAdminClientTest.java | 82 +- .../cloud/pubsub/v1/TopicAdminClientTest.java | 92 +- .../google/pubsub/v1/ProjectTopicName.java | 2 +- .../com/google/pubsub/v1/PubsubProto.java | 459 ++++---- .../com/google/pubsub/v1/RetryPolicy.java | 1033 +++++++++++++++++ .../pubsub/v1/RetryPolicyOrBuilder.java | 101 ++ .../com/google/pubsub/v1/Subscription.java | 588 ++++++++++ .../pubsub/v1/SubscriptionOrBuilder.java | 96 ++ .../java/com/google/pubsub/v1/TopicName.java | 218 +++- .../main/proto/google/pubsub/v1/pubsub.proto | 42 + renovate.json | 6 +- synth.metadata | 21 +- synth.py | 467 ++++++++ 22 files changed, 3338 insertions(+), 485 deletions(-) create mode 100644 .kokoro/common.sh create mode 100644 proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicy.java create mode 100644 proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicyOrBuilder.java diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0bd0ee062..f2a217cb7 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1 +1,7 @@ -Fixes # (it's a good idea to open an issue first for context and/or discussion) \ No newline at end of file +Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: +- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-pubsub/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea +- [ ] Ensure the tests and linter pass +- [ ] Code coverage does not decrease (if any source code was changed) +- [ ] Appropriate docs were updated (if necessary) + +Fixes # ☕️ diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 2bac08ee0..bbca9bc9d 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -20,17 +20,22 @@ scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) ## cd to the parent directory, i.e. the root of the git repo cd ${scriptDir}/.. +# include common functions +source ${scriptDir}/common.sh + # Print out Java version java -version echo ${JOB_TYPE} -mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true \ - -T 1C +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true \ + -T 1C # if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then diff --git a/.kokoro/common.sh b/.kokoro/common.sh new file mode 100644 index 000000000..a3bbc5f67 --- /dev/null +++ b/.kokoro/common.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# set -eo pipefail + +function retry_with_backoff { + attempts_left=$1 + sleep_seconds=$2 + shift 2 + command=$@ + + echo "${command}" + ${command} + exit_code=$? + + if [[ $exit_code == 0 ]] + then + return 0 + fi + + # failure + if [[ ${attempts_left} > 0 ]] + then + echo "failure (${exit_code}), sleeping ${sleep_seconds}..." + sleep ${sleep_seconds} + new_attempts=$((${attempts_left} - 1)) + new_sleep=$((${sleep_seconds} * 2)) + retry_with_backoff ${new_attempts} ${new_sleep} ${command} + fi + + return $exit_code +} diff --git a/.kokoro/dependencies.sh b/.kokoro/dependencies.sh index eb1cb86db..0aade871c 100755 --- a/.kokoro/dependencies.sh +++ b/.kokoro/dependencies.sh @@ -15,7 +15,13 @@ set -eo pipefail -cd github/java-pubsub/ +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh # Print out Java java -version @@ -24,8 +30,9 @@ echo $JOB_TYPE export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" # this should run maven enforcer -mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true mvn -B dependency:analyze -DfailOnWarning=true diff --git a/.kokoro/linkage-monitor.sh b/.kokoro/linkage-monitor.sh index 088ded29a..759ab4e2c 100755 --- a/.kokoro/linkage-monitor.sh +++ b/.kokoro/linkage-monitor.sh @@ -17,18 +17,26 @@ set -eo pipefail # Display commands being run. set -x -cd github/java-pubsub/ +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh # Print out Java version java -version echo ${JOB_TYPE} -mvn install -B -V \ - -DskipTests=true \ - -Dclirr.skip=true \ - -Denforcer.skip=true \ - -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true +# attempt to install 3 times with exponential backoff (starting with 10 seconds) +retry_with_backoff 3 10 \ + mvn install -B -V \ + -DskipTests=true \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true # Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR JAR=linkage-monitor-latest-all-deps.jar 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 b5c7b51c7..227271f32 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 @@ -59,6 +59,7 @@ import com.google.pubsub.v1.StreamingPullRequest; import com.google.pubsub.v1.StreamingPullResponse; import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.TopicName; import com.google.pubsub.v1.UpdateSnapshotRequest; import com.google.pubsub.v1.UpdateSubscriptionRequest; import java.io.IOException; @@ -81,7 +82,7 @@ * * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { * ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); - * ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]"); + * TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); * PushConfig pushConfig = PushConfig.newBuilder().build(); * int ackDeadlineSeconds = 0; * Subscription response = subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); @@ -211,7 +212,7 @@ public SubscriberStub getStub() { *

    * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
    *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   PushConfig pushConfig = PushConfig.newBuilder().build();
    *   int ackDeadlineSeconds = 0;
    *   Subscription response = subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
@@ -248,7 +249,7 @@ public SubscriberStub getStub() {
    */
   public final Subscription createSubscription(
       ProjectSubscriptionName name,
-      ProjectTopicName topic,
+      TopicName topic,
       PushConfig pushConfig,
       int ackDeadlineSeconds) {
     Subscription request =
@@ -279,7 +280,7 @@ public final Subscription createSubscription(
    * 

    * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
    *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   PushConfig pushConfig = PushConfig.newBuilder().build();
    *   int ackDeadlineSeconds = 0;
    *   Subscription response = subscriptionAdminClient.createSubscription(name.toString(), topic.toString(), pushConfig, ackDeadlineSeconds);
@@ -344,7 +345,7 @@ public final Subscription createSubscription(
    * 

    * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
    *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   TopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   Subscription request = Subscription.newBuilder()
    *     .setName(name.toString())
    *     .setTopic(topic.toString())
@@ -378,7 +379,77 @@ public final Subscription createSubscription(Subscription request) {
    * 

    * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
    *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-   *   TopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   PushConfig pushConfig = PushConfig.newBuilder().build();
+   *   int ackDeadlineSeconds = 0;
+   *   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(ProjectSubscriptionName, TopicName, PushConfig, + * int)} instead. + */ + public final Subscription createSubscription( + ProjectSubscriptionName name, + ProjectTopicName 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 <a + * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name + * rules</a>. 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: + * + *


+   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+   *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   Subscription request = Subscription.newBuilder()
    *     .setName(name.toString())
    *     .setTopic(topic.toString())
@@ -1924,23 +1995,21 @@ public final UnaryCallable seekCallable() {
    *
    * 

    * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
+   *   ResourceName resource = ProjectName.of("[PROJECT]");
    *   Policy policy = Policy.newBuilder().build();
-   *   Policy response = subscriptionAdminClient.setIamPolicy(formattedResource, policy);
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   Policy response = subscriptionAdminClient.setIamPolicy(request);
    * }
    * 
* - * @param resource REQUIRED: The resource for which the policy is being specified. See the - * operation documentation for the appropriate value for this field. - * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the - * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud - * Platform services (such as Projects) might reject them. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Policy setIamPolicy(String resource, Policy policy) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); - return setIamPolicy(request); + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -1952,22 +2021,25 @@ public final Policy setIamPolicy(String resource, Policy policy) { *

Sample code: * *


-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
+   * try (SubscriptionAdminClient topicAdminClient = SubscriptionAdminClient.create()) {
+   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
    *   Policy policy = Policy.newBuilder().build();
-   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
-   *     .setResource(formattedResource)
-   *     .setPolicy(policy)
-   *     .build();
-   *   Policy response = subscriptionAdminClient.setIamPolicy(request);
+   *   Policy response = topicAdminClient.setIamPolicy(formattedResource, policy);
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead. */ - public final Policy setIamPolicy(SetIamPolicyRequest request) { - return setIamPolicyCallable().call(request); + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -1980,10 +2052,10 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { * *

    * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
+   *   ResourceName resource = ProjectName.of("[PROJECT]");
    *   Policy policy = Policy.newBuilder().build();
    *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
-   *     .setResource(formattedResource)
+   *     .setResource(resource.toString())
    *     .setPolicy(policy)
    *     .build();
    *   ApiFuture<Policy> future = subscriptionAdminClient.setIamPolicyCallable().futureCall(request);
@@ -2005,18 +2077,19 @@ public final UnaryCallable setIamPolicyCallable() {
    *
    * 

    * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
-   *   Policy response = subscriptionAdminClient.getIamPolicy(formattedResource);
+   *   ResourceName resource = ProjectName.of("[PROJECT]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = subscriptionAdminClient.getIamPolicy(request);
    * }
    * 
* - * @param resource REQUIRED: The resource for which the policy is being requested. See the - * operation documentation for the appropriate value for this field. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Policy getIamPolicy(String resource) { - GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); - return getIamPolicy(request); + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -2027,20 +2100,20 @@ public final Policy getIamPolicy(String resource) { *

Sample code: * *


-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
-   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
-   *     .setResource(formattedResource)
-   *     .build();
-   *   Policy response = subscriptionAdminClient.getIamPolicy(request);
+   * try (SubscriptionAdminClient topicAdminClient = SubscriptionAdminClient.create()) {
+   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+   *   Policy response = topicAdminClient.getIamPolicy(formattedResource);
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead. */ - public final Policy getIamPolicy(GetIamPolicyRequest request) { - return getIamPolicyCallable().call(request); + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -2052,9 +2125,9 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) { * *

    * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
+   *   ResourceName resource = ProjectName.of("[PROJECT]");
    *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
-   *     .setResource(formattedResource)
+   *     .setResource(resource.toString())
    *     .build();
    *   ApiFuture<Policy> future = subscriptionAdminClient.getIamPolicyCallable().futureCall(request);
    *   // Do something
@@ -2079,27 +2152,21 @@ public final UnaryCallable getIamPolicyCallable() {
    *
    * 

    * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
+   *   ResourceName resource = ProjectName.of("[PROJECT]");
    *   List<String> permissions = new ArrayList<>();
-   *   TestIamPermissionsResponse response = subscriptionAdminClient.testIamPermissions(formattedResource, permissions);
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   TestIamPermissionsResponse response = subscriptionAdminClient.testIamPermissions(request);
    * }
    * 
* - * @param resource REQUIRED: The resource for which the policy detail is being requested. See the - * operation documentation for the appropriate value for this field. - * @param permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestIamPermissionsResponse testIamPermissions( - String resource, List permissions) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(resource) - .addAllPermissions(permissions) - .build(); - return testIamPermissions(request); + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -2114,22 +2181,29 @@ public final TestIamPermissionsResponse testIamPermissions( *

Sample code: * *


-   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
+   * try (SubscriptionAdminClient topicAdminClient = SubscriptionAdminClient.create()) {
+   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
    *   List<String> permissions = new ArrayList<>();
-   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
-   *     .setResource(formattedResource)
-   *     .addAllPermissions(permissions)
-   *     .build();
-   *   TestIamPermissionsResponse response = subscriptionAdminClient.testIamPermissions(request);
+   *   TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(formattedResource, permissions);
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead. */ - public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { - return testIamPermissionsCallable().call(request); + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -2145,10 +2219,10 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq * *

    * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
-   *   String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
+   *   ResourceName resource = ProjectName.of("[PROJECT]");
    *   List<String> permissions = new ArrayList<>();
    *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
-   *     .setResource(formattedResource)
+   *     .setResource(resource.toString())
    *     .addAllPermissions(permissions)
    *     .build();
    *   ApiFuture<TestIamPermissionsResponse> future = subscriptionAdminClient.testIamPermissionsCallable().futureCall(request);
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 1612e898f..11951c869 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
@@ -49,6 +49,7 @@
 import com.google.pubsub.v1.PublishResponse;
 import com.google.pubsub.v1.PubsubMessage;
 import com.google.pubsub.v1.Topic;
+import com.google.pubsub.v1.TopicName;
 import com.google.pubsub.v1.UpdateTopicRequest;
 import java.io.IOException;
 import java.util.List;
@@ -68,7 +69,7 @@
  * 
  * 
  * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
- *   ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+ *   TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
  *   Topic response = topicAdminClient.createTopic(name);
  * }
  * 
@@ -185,7 +186,7 @@ public PublisherStub getStub() {
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   Topic response = topicAdminClient.createTopic(name);
    * }
    * 
@@ -197,7 +198,7 @@ public PublisherStub getStub() { * length, and it must not start with `"goog"`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Topic createTopic(ProjectTopicName name) { + public final Topic createTopic(TopicName name) { Topic request = Topic.newBuilder().setName(name == null ? null : name.toString()).build(); return createTopic(request); } @@ -212,7 +213,7 @@ public final Topic createTopic(ProjectTopicName name) { * *

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   Topic response = topicAdminClient.createTopic(name.toString());
    * }
    * 
@@ -240,6 +241,34 @@ public final Topic createTopic(String name) { *

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
    *   ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   Topic response = topicAdminClient.createTopic(name);
+   * }
+   * 
+ * + * @param name Required. The name of the topic. It must have the format + * `"projects/{project}/topics/{topic}"`. `{topic}` 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"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #createTopic(TopicName)} instead. + */ + public final Topic createTopic(ProjectTopicName name) { + Topic request = Topic.newBuilder().setName(name == null ? null : name.toString()).build(); + return createTopic(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates the given topic with the given name. See the <a + * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name + * rules</a>. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   Topic request = Topic.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -264,7 +293,7 @@ public final Topic createTopic(Topic request) {
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   Topic request = Topic.newBuilder()
    *     .setName(name.toString())
    *     .build();
@@ -335,7 +364,7 @@ public final UnaryCallable updateTopicCallable() {
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   ByteString data = ByteString.copyFromUtf8("");
    *   PubsubMessage messagesElement = PubsubMessage.newBuilder()
    *     .setData(data)
@@ -351,7 +380,7 @@ public final UnaryCallable updateTopicCallable() {
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
   /* package-private */ final PublishResponse publish(
-      ProjectTopicName topic, List messages) {
+      TopicName topic, List messages) {
     PublishRequest request =
         PublishRequest.newBuilder()
             .setTopic(topic == null ? null : topic.toString())
@@ -368,7 +397,7 @@ public final UnaryCallable updateTopicCallable() {
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   ByteString data = ByteString.copyFromUtf8("");
    *   PubsubMessage messagesElement = PubsubMessage.newBuilder()
    *     .setData(data)
@@ -397,7 +426,7 @@ public final UnaryCallable updateTopicCallable() {
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   ByteString data = ByteString.copyFromUtf8("");
    *   PubsubMessage messagesElement = PubsubMessage.newBuilder()
    *     .setData(data)
@@ -426,7 +455,7 @@ public final UnaryCallable updateTopicCallable() {
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   ByteString data = ByteString.copyFromUtf8("");
    *   PubsubMessage messagesElement = PubsubMessage.newBuilder()
    *     .setData(data)
@@ -454,7 +483,7 @@ public final UnaryCallable updateTopicCallable() {
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   Topic response = topicAdminClient.getTopic(topic);
    * }
    * 
@@ -463,7 +492,7 @@ public final UnaryCallable updateTopicCallable() { * `projects/{project}/topics/{topic}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Topic getTopic(ProjectTopicName topic) { + public final Topic getTopic(TopicName topic) { GetTopicRequest request = GetTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); return getTopic(request); @@ -477,7 +506,7 @@ public final Topic getTopic(ProjectTopicName topic) { * *

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   Topic response = topicAdminClient.getTopic(topic.toString());
    * }
    * 
@@ -500,6 +529,30 @@ public final Topic getTopic(String topic) { *

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
    *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   Topic response = topicAdminClient.getTopic(topic);
+   * }
+   * 
+ * + * @param topic Required. The name of the topic to get. Format is + * `projects/{project}/topics/{topic}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #getTopic(TopicName)} instead. + */ + public final Topic getTopic(ProjectTopicName topic) { + GetTopicRequest request = + GetTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); + return getTopic(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the configuration of a topic. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   GetTopicRequest request = GetTopicRequest.newBuilder()
    *     .setTopic(topic.toString())
    *     .build();
@@ -522,7 +575,7 @@ public final Topic getTopic(GetTopicRequest request) {
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   GetTopicRequest request = GetTopicRequest.newBuilder()
    *     .setTopic(topic.toString())
    *     .build();
@@ -675,7 +728,7 @@ public final UnaryCallable listTopicsCall
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   for (ProjectSubscriptionName element : topicAdminClient.listTopicSubscriptions(topic).iterateAllAsProjectSubscriptionName()) {
    *     // doThingsWith(element);
    *   }
@@ -686,7 +739,7 @@ public final UnaryCallable listTopicsCall
    *     `projects/{project}/topics/{topic}`.
    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
    */
-  public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(ProjectTopicName topic) {
+  public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(TopicName topic) {
     ListTopicSubscriptionsRequest request =
         ListTopicSubscriptionsRequest.newBuilder()
             .setTopic(topic == null ? null : topic.toString())
@@ -702,7 +755,7 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(ProjectT
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   for (ProjectSubscriptionName element : topicAdminClient.listTopicSubscriptions(topic.toString()).iterateAllAsProjectSubscriptionName()) {
    *     // doThingsWith(element);
    *   }
@@ -728,6 +781,34 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(String t
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
    *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   for (ProjectSubscriptionName element : topicAdminClient.listTopicSubscriptions(topic).iterateAllAsProjectSubscriptionName()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param topic Required. The name of the topic that subscriptions are attached to. Format is + * `projects/{project}/topics/{topic}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #listTopicSubscriptions(TopicName)} instead. + */ + public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(ProjectTopicName topic) { + ListTopicSubscriptionsRequest request = + ListTopicSubscriptionsRequest.newBuilder() + .setTopic(topic == null ? null : topic.toString()) + .build(); + return listTopicSubscriptions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the names of the subscriptions on this topic. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   ListTopicSubscriptionsRequest request = ListTopicSubscriptionsRequest.newBuilder()
    *     .setTopic(topic.toString())
    *     .build();
@@ -753,7 +834,7 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   ListTopicSubscriptionsRequest request = ListTopicSubscriptionsRequest.newBuilder()
    *     .setTopic(topic.toString())
    *     .build();
@@ -778,7 +859,7 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   ListTopicSubscriptionsRequest request = ListTopicSubscriptionsRequest.newBuilder()
    *     .setTopic(topic.toString())
    *     .build();
@@ -813,7 +894,7 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   topicAdminClient.deleteTopic(topic);
    * }
    * 
@@ -822,7 +903,7 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions( * `projects/{project}/topics/{topic}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final void deleteTopic(ProjectTopicName topic) { + public final void deleteTopic(TopicName topic) { DeleteTopicRequest request = DeleteTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); deleteTopic(request); @@ -839,7 +920,7 @@ public final void deleteTopic(ProjectTopicName topic) { * *

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   topicAdminClient.deleteTopic(topic.toString());
    * }
    * 
@@ -865,6 +946,33 @@ public final void deleteTopic(String topic) { *

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
    *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   topicAdminClient.deleteTopic(topic);
+   * }
+   * 
+ * + * @param topic Required. Name of the topic to delete. Format is + * `projects/{project}/topics/{topic}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #deleteTopic(TopicName)} instead. + */ + public final void deleteTopic(ProjectTopicName topic) { + DeleteTopicRequest request = + DeleteTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); + deleteTopic(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a + * topic is deleted, a new topic may be created with the same name; this is an entirely new topic + * with none of the old configuration or subscriptions. Existing subscriptions to this topic are + * not deleted, but their `topic` field is set to `_deleted-topic_`. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   DeleteTopicRequest request = DeleteTopicRequest.newBuilder()
    *     .setTopic(topic.toString())
    *     .build();
@@ -890,7 +998,7 @@ public final void deleteTopic(DeleteTopicRequest request) {
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
    *   DeleteTopicRequest request = DeleteTopicRequest.newBuilder()
    *     .setTopic(topic.toString())
    *     .build();
@@ -914,23 +1022,21 @@ public final UnaryCallable deleteTopicCallable() {
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+   *   ResourceName resource = ProjectName.of("[PROJECT]");
    *   Policy policy = Policy.newBuilder().build();
-   *   Policy response = topicAdminClient.setIamPolicy(formattedResource, policy);
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   Policy response = topicAdminClient.setIamPolicy(request);
    * }
    * 
* - * @param resource REQUIRED: The resource for which the policy is being specified. See the - * operation documentation for the appropriate value for this field. - * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the - * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud - * Platform services (such as Projects) might reject them. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Policy setIamPolicy(String resource, Policy policy) { - SetIamPolicyRequest request = - SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); - return setIamPolicy(request); + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -945,19 +1051,22 @@ public final Policy setIamPolicy(String resource, Policy policy) { * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { * String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]"); * Policy policy = Policy.newBuilder().build(); - * SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() - * .setResource(formattedResource) - * .setPolicy(policy) - * .build(); - * Policy response = topicAdminClient.setIamPolicy(request); + * Policy response = topicAdminClient.setIamPolicy(formattedResource, policy); * } *
* - * @param request The request object containing all of the parameters for the API call. + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead. */ - public final Policy setIamPolicy(SetIamPolicyRequest request) { - return setIamPolicyCallable().call(request); + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -970,10 +1079,10 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { * *

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+   *   ResourceName resource = ProjectName.of("[PROJECT]");
    *   Policy policy = Policy.newBuilder().build();
    *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
-   *     .setResource(formattedResource)
+   *     .setResource(resource.toString())
    *     .setPolicy(policy)
    *     .build();
    *   ApiFuture<Policy> future = topicAdminClient.setIamPolicyCallable().futureCall(request);
@@ -995,18 +1104,19 @@ public final UnaryCallable setIamPolicyCallable() {
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
-   *   Policy response = topicAdminClient.getIamPolicy(formattedResource);
+   *   ResourceName resource = ProjectName.of("[PROJECT]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = topicAdminClient.getIamPolicy(request);
    * }
    * 
* - * @param resource REQUIRED: The resource for which the policy is being requested. See the - * operation documentation for the appropriate value for this field. + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final Policy getIamPolicy(String resource) { - GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); - return getIamPolicy(request); + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -1019,18 +1129,18 @@ public final Policy getIamPolicy(String resource) { *

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
    *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
-   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
-   *     .setResource(formattedResource)
-   *     .build();
-   *   Policy response = topicAdminClient.getIamPolicy(request);
+   *   Policy response = topicAdminClient.getIamPolicy(formattedResource);
    * }
    * 
* - * @param request The request object containing all of the parameters for the API call. + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead. */ - public final Policy getIamPolicy(GetIamPolicyRequest request) { - return getIamPolicyCallable().call(request); + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -1042,9 +1152,9 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) { * *

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+   *   ResourceName resource = ProjectName.of("[PROJECT]");
    *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
-   *     .setResource(formattedResource)
+   *     .setResource(resource.toString())
    *     .build();
    *   ApiFuture<Policy> future = topicAdminClient.getIamPolicyCallable().futureCall(request);
    *   // Do something
@@ -1069,27 +1179,21 @@ public final UnaryCallable getIamPolicyCallable() {
    *
    * 

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+   *   ResourceName resource = ProjectName.of("[PROJECT]");
    *   List<String> permissions = new ArrayList<>();
-   *   TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(formattedResource, permissions);
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(request);
    * }
    * 
* - * @param resource REQUIRED: The resource for which the policy detail is being requested. See the - * operation documentation for the appropriate value for this field. - * @param permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - public final TestIamPermissionsResponse testIamPermissions( - String resource, List permissions) { - TestIamPermissionsRequest request = - TestIamPermissionsRequest.newBuilder() - .setResource(resource) - .addAllPermissions(permissions) - .build(); - return testIamPermissions(request); + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -1107,19 +1211,26 @@ public final TestIamPermissionsResponse testIamPermissions( * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { * String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]"); * List<String> permissions = new ArrayList<>(); - * TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() - * .setResource(formattedResource) - * .addAllPermissions(permissions) - * .build(); - * TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(request); + * TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(formattedResource, permissions); * } *
* - * @param request The request object containing all of the parameters for the API call. + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead. */ - public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { - return testIamPermissionsCallable().call(request); + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD @@ -1135,10 +1246,10 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq * *

    * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
-   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+   *   ResourceName resource = ProjectName.of("[PROJECT]");
    *   List<String> permissions = new ArrayList<>();
    *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
-   *     .setResource(formattedResource)
+   *     .setResource(resource.toString())
    *     .addAllPermissions(permissions)
    *     .build();
    *   ApiFuture<TestIamPermissionsResponse> future = topicAdminClient.testIamPermissionsCallable().futureCall(request);
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 1df92ab40..f7d1e28c2 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
@@ -31,7 +31,7 @@
  * 
  * 
  * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
- *   ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+ *   TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
  *   Topic response = topicAdminClient.createTopic(name);
  * }
  * 
@@ -51,7 +51,7 @@
  * 
  * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
  *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
- *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+ *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
  *   PushConfig pushConfig = PushConfig.newBuilder().build();
  *   int ackDeadlineSeconds = 0;
  *   Subscription response = subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
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 34f4f2cda..356f1c207 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
@@ -94,7 +94,6 @@ public void testTopicPolicy() {
     ProjectTopicName topicName =
         ProjectTopicName.of(projectId, formatForTest("testing-topic-policy"));
     topicAdminClient.createTopic(topicName);
-
     Policy policy = topicAdminClient.getIamPolicy(topicName.toString());
     Binding binding =
         Binding.newBuilder().setRole("roles/viewer").addMembers("allAuthenticatedUsers").build();
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 cd9367837..bfe959b50 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
@@ -29,6 +29,7 @@
 import com.google.api.gax.rpc.BidiStreamingCallable;
 import com.google.api.gax.rpc.InvalidArgumentException;
 import com.google.api.gax.rpc.StatusCode;
+import com.google.api.resourcenames.ResourceName;
 import com.google.common.collect.Lists;
 import com.google.iam.v1.GetIamPolicyRequest;
 import com.google.iam.v1.Policy;
@@ -54,11 +55,9 @@
 import com.google.pubsub.v1.ProjectName;
 import com.google.pubsub.v1.ProjectSnapshotName;
 import com.google.pubsub.v1.ProjectSubscriptionName;
-import com.google.pubsub.v1.ProjectTopicName;
 import com.google.pubsub.v1.PullRequest;
 import com.google.pubsub.v1.PullResponse;
 import com.google.pubsub.v1.PushConfig;
-import com.google.pubsub.v1.ReceivedMessage;
 import com.google.pubsub.v1.SeekRequest;
 import com.google.pubsub.v1.SeekResponse;
 import com.google.pubsub.v1.Snapshot;
@@ -131,10 +130,11 @@ public void tearDown() throws Exception {
   @SuppressWarnings("all")
   public void createSubscriptionTest() {
     ProjectSubscriptionName name2 = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-    TopicName topic2 = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName topic2 = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
     int ackDeadlineSeconds2 = 921632575;
     boolean retainAckedMessages = false;
     boolean enableMessageOrdering = true;
+    String filter = "filter-1274492040";
     Subscription expectedResponse =
         Subscription.newBuilder()
             .setName(name2.toString())
@@ -142,11 +142,12 @@ public void createSubscriptionTest() {
             .setAckDeadlineSeconds(ackDeadlineSeconds2)
             .setRetainAckedMessages(retainAckedMessages)
             .setEnableMessageOrdering(enableMessageOrdering)
+            .setFilter(filter)
             .build();
     mockSubscriber.addResponse(expectedResponse);
 
     ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-    ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
     PushConfig pushConfig = PushConfig.newBuilder().build();
     int ackDeadlineSeconds = 2135351438;
 
@@ -159,7 +160,7 @@ public void createSubscriptionTest() {
     Subscription actualRequest = (Subscription) actualRequests.get(0);
 
     Assert.assertEquals(name, ProjectSubscriptionName.parse(actualRequest.getName()));
-    Assert.assertEquals(Objects.toString(topic), actualRequest.getTopic());
+    Assert.assertEquals(topic, TopicName.parse(actualRequest.getTopic()));
     Assert.assertEquals(pushConfig, actualRequest.getPushConfig());
     Assert.assertEquals(ackDeadlineSeconds, actualRequest.getAckDeadlineSeconds());
     Assert.assertTrue(
@@ -176,7 +177,7 @@ public void createSubscriptionExceptionTest() throws Exception {
 
     try {
       ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-      ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+      TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
       PushConfig pushConfig = PushConfig.newBuilder().build();
       int ackDeadlineSeconds = 2135351438;
 
@@ -191,10 +192,11 @@ public void createSubscriptionExceptionTest() throws Exception {
   @SuppressWarnings("all")
   public void getSubscriptionTest() {
     ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-    TopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
     int ackDeadlineSeconds = 2135351438;
     boolean retainAckedMessages = false;
     boolean enableMessageOrdering = true;
+    String filter = "filter-1274492040";
     Subscription expectedResponse =
         Subscription.newBuilder()
             .setName(name.toString())
@@ -202,6 +204,7 @@ public void getSubscriptionTest() {
             .setAckDeadlineSeconds(ackDeadlineSeconds)
             .setRetainAckedMessages(retainAckedMessages)
             .setEnableMessageOrdering(enableMessageOrdering)
+            .setFilter(filter)
             .build();
     mockSubscriber.addResponse(expectedResponse);
 
@@ -244,10 +247,11 @@ public void getSubscriptionExceptionTest() throws Exception {
   @SuppressWarnings("all")
   public void updateSubscriptionTest() {
     ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
-    TopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
     int ackDeadlineSeconds2 = 921632575;
     boolean retainAckedMessages = false;
     boolean enableMessageOrdering = true;
+    String filter = "filter-1274492040";
     Subscription expectedResponse =
         Subscription.newBuilder()
             .setName(name.toString())
@@ -255,6 +259,7 @@ public void updateSubscriptionTest() {
             .setAckDeadlineSeconds(ackDeadlineSeconds2)
             .setRetainAckedMessages(retainAckedMessages)
             .setEnableMessageOrdering(enableMessageOrdering)
+            .setFilter(filter)
             .build();
     mockSubscriber.addResponse(expectedResponse);
 
@@ -538,10 +543,7 @@ public void pullExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void streamingPullTest() throws Exception {
-    ReceivedMessage receivedMessagesElement = ReceivedMessage.newBuilder().build();
-    List receivedMessages = Arrays.asList(receivedMessagesElement);
-    StreamingPullResponse expectedResponse =
-        StreamingPullResponse.newBuilder().addAllReceivedMessages(receivedMessages).build();
+    StreamingPullResponse expectedResponse = StreamingPullResponse.newBuilder().build();
     mockSubscriber.addResponse(expectedResponse);
     ProjectSubscriptionName subscription =
         ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
@@ -695,7 +697,7 @@ public void listSnapshotsExceptionTest() throws Exception {
   @SuppressWarnings("all")
   public void createSnapshotTest() {
     ProjectSnapshotName name2 = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-    ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
     Snapshot expectedResponse =
         Snapshot.newBuilder().setName(name2.toString()).setTopic(topic.toString()).build();
     mockSubscriber.addResponse(expectedResponse);
@@ -742,7 +744,7 @@ public void createSnapshotExceptionTest() throws Exception {
   @SuppressWarnings("all")
   public void updateSnapshotTest() {
     ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
-    ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
     Snapshot expectedResponse =
         Snapshot.newBuilder().setName(name.toString()).setTopic(topic.toString()).build();
     mockSubscriber.addResponse(expectedResponse);
@@ -886,17 +888,19 @@ public void setIamPolicyTest() {
     Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build();
     mockIAMPolicy.addResponse(expectedResponse);
 
-    String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
+    ResourceName resource = ProjectName.of("[PROJECT]");
     Policy policy = Policy.newBuilder().build();
+    SetIamPolicyRequest request =
+        SetIamPolicyRequest.newBuilder().setResource(resource.toString()).setPolicy(policy).build();
 
-    Policy actualResponse = client.setIamPolicy(formattedResource, policy);
+    Policy actualResponse = client.setIamPolicy(request);
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockIAMPolicy.getRequests();
     Assert.assertEquals(1, actualRequests.size());
     SetIamPolicyRequest actualRequest = (SetIamPolicyRequest) actualRequests.get(0);
 
-    Assert.assertEquals(formattedResource, actualRequest.getResource());
+    Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource()));
     Assert.assertEquals(policy, actualRequest.getPolicy());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
@@ -911,10 +915,15 @@ public void setIamPolicyExceptionTest() throws Exception {
     mockIAMPolicy.addException(exception);
 
     try {
-      String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
+      ResourceName resource = ProjectName.of("[PROJECT]");
       Policy policy = Policy.newBuilder().build();
+      SetIamPolicyRequest request =
+          SetIamPolicyRequest.newBuilder()
+              .setResource(resource.toString())
+              .setPolicy(policy)
+              .build();
 
-      client.setIamPolicy(formattedResource, policy);
+      client.setIamPolicy(request);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
@@ -929,16 +938,18 @@ public void getIamPolicyTest() {
     Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build();
     mockIAMPolicy.addResponse(expectedResponse);
 
-    String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
+    ResourceName resource = ProjectName.of("[PROJECT]");
+    GetIamPolicyRequest request =
+        GetIamPolicyRequest.newBuilder().setResource(resource.toString()).build();
 
-    Policy actualResponse = client.getIamPolicy(formattedResource);
+    Policy actualResponse = client.getIamPolicy(request);
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockIAMPolicy.getRequests();
     Assert.assertEquals(1, actualRequests.size());
     GetIamPolicyRequest actualRequest = (GetIamPolicyRequest) actualRequests.get(0);
 
-    Assert.assertEquals(formattedResource, actualRequest.getResource());
+    Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -952,9 +963,11 @@ public void getIamPolicyExceptionTest() throws Exception {
     mockIAMPolicy.addException(exception);
 
     try {
-      String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
+      ResourceName resource = ProjectName.of("[PROJECT]");
+      GetIamPolicyRequest request =
+          GetIamPolicyRequest.newBuilder().setResource(resource.toString()).build();
 
-      client.getIamPolicy(formattedResource);
+      client.getIamPolicy(request);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
@@ -967,18 +980,22 @@ public void testIamPermissionsTest() {
     TestIamPermissionsResponse expectedResponse = TestIamPermissionsResponse.newBuilder().build();
     mockIAMPolicy.addResponse(expectedResponse);
 
-    String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
+    ResourceName resource = ProjectName.of("[PROJECT]");
     List permissions = new ArrayList<>();
+    TestIamPermissionsRequest request =
+        TestIamPermissionsRequest.newBuilder()
+            .setResource(resource.toString())
+            .addAllPermissions(permissions)
+            .build();
 
-    TestIamPermissionsResponse actualResponse =
-        client.testIamPermissions(formattedResource, permissions);
+    TestIamPermissionsResponse actualResponse = client.testIamPermissions(request);
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockIAMPolicy.getRequests();
     Assert.assertEquals(1, actualRequests.size());
     TestIamPermissionsRequest actualRequest = (TestIamPermissionsRequest) actualRequests.get(0);
 
-    Assert.assertEquals(formattedResource, actualRequest.getResource());
+    Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource()));
     Assert.assertEquals(permissions, actualRequest.getPermissionsList());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
@@ -993,10 +1010,15 @@ public void testIamPermissionsExceptionTest() throws Exception {
     mockIAMPolicy.addException(exception);
 
     try {
-      String formattedResource = ProjectSubscriptionName.format("[PROJECT]", "[SUBSCRIPTION]");
+      ResourceName resource = ProjectName.of("[PROJECT]");
       List permissions = new ArrayList<>();
+      TestIamPermissionsRequest request =
+          TestIamPermissionsRequest.newBuilder()
+              .setResource(resource.toString())
+              .addAllPermissions(permissions)
+              .build();
 
-      client.testIamPermissions(formattedResource, permissions);
+      client.testIamPermissions(request);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
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 72d7bf86c..7d524361b 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
@@ -25,6 +25,7 @@
 import com.google.api.gax.grpc.testing.MockServiceHelper;
 import com.google.api.gax.rpc.ApiClientHeaderProvider;
 import com.google.api.gax.rpc.InvalidArgumentException;
+import com.google.api.resourcenames.ResourceName;
 import com.google.common.collect.Lists;
 import com.google.iam.v1.GetIamPolicyRequest;
 import com.google.iam.v1.Policy;
@@ -43,11 +44,11 @@
 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;
 import com.google.pubsub.v1.PubsubMessage;
 import com.google.pubsub.v1.Topic;
+import com.google.pubsub.v1.TopicName;
 import com.google.pubsub.v1.UpdateTopicRequest;
 import io.grpc.Status;
 import io.grpc.StatusRuntimeException;
@@ -55,6 +56,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Objects;
 import java.util.UUID;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -109,13 +111,13 @@ public void tearDown() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void createTopicTest() {
-    ProjectTopicName name2 = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName name2 = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
     String kmsKeyName = "kmsKeyName2094986649";
     Topic expectedResponse =
         Topic.newBuilder().setName(name2.toString()).setKmsKeyName(kmsKeyName).build();
     mockPublisher.addResponse(expectedResponse);
 
-    ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
 
     Topic actualResponse = client.createTopic(name);
     Assert.assertEquals(expectedResponse, actualResponse);
@@ -124,7 +126,7 @@ public void createTopicTest() {
     Assert.assertEquals(1, actualRequests.size());
     Topic actualRequest = (Topic) actualRequests.get(0);
 
-    Assert.assertEquals(name, ProjectTopicName.parse(actualRequest.getName()));
+    Assert.assertEquals(name, TopicName.parse(actualRequest.getName()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -138,7 +140,7 @@ public void createTopicExceptionTest() throws Exception {
     mockPublisher.addException(exception);
 
     try {
-      ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+      TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
 
       client.createTopic(name);
       Assert.fail("No exception raised");
@@ -150,7 +152,7 @@ public void createTopicExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void updateTopicTest() {
-    ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
     String kmsKeyName = "kmsKeyName2094986649";
     Topic expectedResponse =
         Topic.newBuilder().setName(name.toString()).setKmsKeyName(kmsKeyName).build();
@@ -204,7 +206,7 @@ public void publishTest() {
         PublishResponse.newBuilder().addAllMessageIds(messageIds).build();
     mockPublisher.addResponse(expectedResponse);
 
-    ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
     ByteString data = ByteString.copyFromUtf8("-86");
     PubsubMessage messagesElement = PubsubMessage.newBuilder().setData(data).build();
     List messages = Arrays.asList(messagesElement);
@@ -216,7 +218,7 @@ public void publishTest() {
     Assert.assertEquals(1, actualRequests.size());
     PublishRequest actualRequest = (PublishRequest) actualRequests.get(0);
 
-    Assert.assertEquals(topic, ProjectTopicName.parse(actualRequest.getTopic()));
+    Assert.assertEquals(topic, TopicName.parse(actualRequest.getTopic()));
     Assert.assertEquals(messages, actualRequest.getMessagesList());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
@@ -231,7 +233,7 @@ public void publishExceptionTest() throws Exception {
     mockPublisher.addException(exception);
 
     try {
-      ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+      TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
       ByteString data = ByteString.copyFromUtf8("-86");
       PubsubMessage messagesElement = PubsubMessage.newBuilder().setData(data).build();
       List messages = Arrays.asList(messagesElement);
@@ -246,13 +248,13 @@ public void publishExceptionTest() throws Exception {
   @Test
   @SuppressWarnings("all")
   public void getTopicTest() {
-    ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
     String kmsKeyName = "kmsKeyName2094986649";
     Topic expectedResponse =
         Topic.newBuilder().setName(name.toString()).setKmsKeyName(kmsKeyName).build();
     mockPublisher.addResponse(expectedResponse);
 
-    ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
 
     Topic actualResponse = client.getTopic(topic);
     Assert.assertEquals(expectedResponse, actualResponse);
@@ -261,7 +263,7 @@ public void getTopicTest() {
     Assert.assertEquals(1, actualRequests.size());
     GetTopicRequest actualRequest = (GetTopicRequest) actualRequests.get(0);
 
-    Assert.assertEquals(topic, ProjectTopicName.parse(actualRequest.getTopic()));
+    Assert.assertEquals(topic, TopicName.parse(actualRequest.getTopic()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -275,7 +277,7 @@ public void getTopicExceptionTest() throws Exception {
     mockPublisher.addException(exception);
 
     try {
-      ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+      TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
 
       client.getTopic(topic);
       Assert.fail("No exception raised");
@@ -346,7 +348,7 @@ public void listTopicSubscriptionsTest() {
             .build();
     mockPublisher.addResponse(expectedResponse);
 
-    ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
 
     ListTopicSubscriptionsPagedResponse pagedListResponse = client.listTopicSubscriptions(topic);
 
@@ -365,7 +367,7 @@ public void listTopicSubscriptionsTest() {
     ListTopicSubscriptionsRequest actualRequest =
         (ListTopicSubscriptionsRequest) actualRequests.get(0);
 
-    Assert.assertEquals(topic, ProjectTopicName.parse(actualRequest.getTopic()));
+    Assert.assertEquals(topic, TopicName.parse(actualRequest.getTopic()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -379,7 +381,7 @@ public void listTopicSubscriptionsExceptionTest() throws Exception {
     mockPublisher.addException(exception);
 
     try {
-      ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+      TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
 
       client.listTopicSubscriptions(topic);
       Assert.fail("No exception raised");
@@ -394,7 +396,7 @@ public void deleteTopicTest() {
     Empty expectedResponse = Empty.newBuilder().build();
     mockPublisher.addResponse(expectedResponse);
 
-    ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+    TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
 
     client.deleteTopic(topic);
 
@@ -402,7 +404,7 @@ public void deleteTopicTest() {
     Assert.assertEquals(1, actualRequests.size());
     DeleteTopicRequest actualRequest = (DeleteTopicRequest) actualRequests.get(0);
 
-    Assert.assertEquals(topic, ProjectTopicName.parse(actualRequest.getTopic()));
+    Assert.assertEquals(topic, TopicName.parse(actualRequest.getTopic()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -416,7 +418,7 @@ public void deleteTopicExceptionTest() throws Exception {
     mockPublisher.addException(exception);
 
     try {
-      ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+      TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
 
       client.deleteTopic(topic);
       Assert.fail("No exception raised");
@@ -433,17 +435,19 @@ public void setIamPolicyTest() {
     Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build();
     mockIAMPolicy.addResponse(expectedResponse);
 
-    String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+    ResourceName resource = ProjectName.of("[PROJECT]");
     Policy policy = Policy.newBuilder().build();
+    SetIamPolicyRequest request =
+        SetIamPolicyRequest.newBuilder().setResource(resource.toString()).setPolicy(policy).build();
 
-    Policy actualResponse = client.setIamPolicy(formattedResource, policy);
+    Policy actualResponse = client.setIamPolicy(request);
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockIAMPolicy.getRequests();
     Assert.assertEquals(1, actualRequests.size());
     SetIamPolicyRequest actualRequest = (SetIamPolicyRequest) actualRequests.get(0);
 
-    Assert.assertEquals(formattedResource, actualRequest.getResource());
+    Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource()));
     Assert.assertEquals(policy, actualRequest.getPolicy());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
@@ -458,10 +462,15 @@ public void setIamPolicyExceptionTest() throws Exception {
     mockIAMPolicy.addException(exception);
 
     try {
-      String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+      ResourceName resource = ProjectName.of("[PROJECT]");
       Policy policy = Policy.newBuilder().build();
+      SetIamPolicyRequest request =
+          SetIamPolicyRequest.newBuilder()
+              .setResource(resource.toString())
+              .setPolicy(policy)
+              .build();
 
-      client.setIamPolicy(formattedResource, policy);
+      client.setIamPolicy(request);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
@@ -476,16 +485,18 @@ public void getIamPolicyTest() {
     Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build();
     mockIAMPolicy.addResponse(expectedResponse);
 
-    String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+    ResourceName resource = ProjectName.of("[PROJECT]");
+    GetIamPolicyRequest request =
+        GetIamPolicyRequest.newBuilder().setResource(resource.toString()).build();
 
-    Policy actualResponse = client.getIamPolicy(formattedResource);
+    Policy actualResponse = client.getIamPolicy(request);
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockIAMPolicy.getRequests();
     Assert.assertEquals(1, actualRequests.size());
     GetIamPolicyRequest actualRequest = (GetIamPolicyRequest) actualRequests.get(0);
 
-    Assert.assertEquals(formattedResource, actualRequest.getResource());
+    Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource()));
     Assert.assertTrue(
         channelProvider.isHeaderSent(
             ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
@@ -499,9 +510,11 @@ public void getIamPolicyExceptionTest() throws Exception {
     mockIAMPolicy.addException(exception);
 
     try {
-      String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+      ResourceName resource = ProjectName.of("[PROJECT]");
+      GetIamPolicyRequest request =
+          GetIamPolicyRequest.newBuilder().setResource(resource.toString()).build();
 
-      client.getIamPolicy(formattedResource);
+      client.getIamPolicy(request);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
@@ -514,18 +527,22 @@ public void testIamPermissionsTest() {
     TestIamPermissionsResponse expectedResponse = TestIamPermissionsResponse.newBuilder().build();
     mockIAMPolicy.addResponse(expectedResponse);
 
-    String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+    ResourceName resource = ProjectName.of("[PROJECT]");
     List permissions = new ArrayList<>();
+    TestIamPermissionsRequest request =
+        TestIamPermissionsRequest.newBuilder()
+            .setResource(resource.toString())
+            .addAllPermissions(permissions)
+            .build();
 
-    TestIamPermissionsResponse actualResponse =
-        client.testIamPermissions(formattedResource, permissions);
+    TestIamPermissionsResponse actualResponse = client.testIamPermissions(request);
     Assert.assertEquals(expectedResponse, actualResponse);
 
     List actualRequests = mockIAMPolicy.getRequests();
     Assert.assertEquals(1, actualRequests.size());
     TestIamPermissionsRequest actualRequest = (TestIamPermissionsRequest) actualRequests.get(0);
 
-    Assert.assertEquals(formattedResource, actualRequest.getResource());
+    Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource()));
     Assert.assertEquals(permissions, actualRequest.getPermissionsList());
     Assert.assertTrue(
         channelProvider.isHeaderSent(
@@ -540,10 +557,15 @@ public void testIamPermissionsExceptionTest() throws Exception {
     mockIAMPolicy.addException(exception);
 
     try {
-      String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+      ResourceName resource = ProjectName.of("[PROJECT]");
       List permissions = new ArrayList<>();
+      TestIamPermissionsRequest request =
+          TestIamPermissionsRequest.newBuilder()
+              .setResource(resource.toString())
+              .addAllPermissions(permissions)
+              .build();
 
-      client.testIamPermissions(formattedResource, permissions);
+      client.testIamPermissions(request);
       Assert.fail("No exception raised");
     } catch (InvalidArgumentException e) {
       // Expected exception
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ProjectTopicName.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ProjectTopicName.java
index 9549f7c65..abfffb2ee 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ProjectTopicName.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ProjectTopicName.java
@@ -122,7 +122,7 @@ public String toString() {
   }
 
   /** Builder for ProjectTopicName. */
-  public static class Builder {
+  public static class Builder extends TopicName.Builder {
 
     private String project;
     private String topic;
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubProto.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubProto.java
index 44f66abf3..419f8a825 100644
--- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubProto.java
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PubsubProto.java
@@ -99,6 +99,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r
       internal_static_google_pubsub_v1_Subscription_LabelsEntry_descriptor;
   static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
       internal_static_google_pubsub_v1_Subscription_LabelsEntry_fieldAccessorTable;
+  static final com.google.protobuf.Descriptors.Descriptor
+      internal_static_google_pubsub_v1_RetryPolicy_descriptor;
+  static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internal_static_google_pubsub_v1_RetryPolicy_fieldAccessorTable;
   static final com.google.protobuf.Descriptors.Descriptor
       internal_static_google_pubsub_v1_DeadLetterPolicy_descriptor;
   static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
@@ -273,8 +277,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "oken\030\003 \001(\t\"H\n\032ListTopicSnapshotsResponse"
           + "\022\021\n\tsnapshots\030\001 \003(\t\022\027\n\017next_page_token\030\002"
           + " \001(\t\"H\n\022DeleteTopicRequest\0222\n\005topic\030\001 \001("
-          + "\tB#\340A\002\372A\035\n\033pubsub.googleapis.com/Topic\"\351"
-          + "\004\n\014Subscription\022\021\n\004name\030\001 \001(\tB\003\340A\002\0222\n\005to"
+          + "\tB#\340A\002\372A\035\n\033pubsub.googleapis.com/Topic\"\256"
+          + "\005\n\014Subscription\022\021\n\004name\030\001 \001(\tB\003\340A\002\0222\n\005to"
           + "pic\030\002 \001(\tB#\340A\002\372A\035\n\033pubsub.googleapis.com"
           + "/Topic\0221\n\013push_config\030\004 \001(\0132\034.google.pub"
           + "sub.v1.PushConfig\022\034\n\024ack_deadline_second"
@@ -284,200 +288,205 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "google.pubsub.v1.Subscription.LabelsEntr"
           + "y\022\037\n\027enable_message_ordering\030\n \001(\010\022=\n\021ex"
           + "piration_policy\030\013 \001(\0132\".google.pubsub.v1"
-          + ".ExpirationPolicy\022>\n\022dead_letter_policy\030"
-          + "\r \001(\0132\".google.pubsub.v1.DeadLetterPolic"
-          + "y\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002"
-          + " \001(\t:\0028\001:X\352AU\n\"pubsub.googleapis.com/Sub"
-          + "scription\022/projects/{project}/subscripti"
-          + "ons/{subscription}\"L\n\020DeadLetterPolicy\022\031"
-          + "\n\021dead_letter_topic\030\001 \001(\t\022\035\n\025max_deliver"
-          + "y_attempts\030\002 \001(\005\":\n\020ExpirationPolicy\022&\n\003"
-          + "ttl\030\001 \001(\0132\031.google.protobuf.Duration\"\255\002\n"
-          + "\nPushConfig\022\025\n\rpush_endpoint\030\001 \001(\t\022@\n\nat"
-          + "tributes\030\002 \003(\0132,.google.pubsub.v1.PushCo"
-          + "nfig.AttributesEntry\022<\n\noidc_token\030\003 \001(\013"
-          + "2&.google.pubsub.v1.PushConfig.OidcToken"
-          + "H\000\032<\n\tOidcToken\022\035\n\025service_account_email"
-          + "\030\001 \001(\t\022\020\n\010audience\030\002 \001(\t\0321\n\017AttributesEn"
-          + "try\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\027\n\025a"
-          + "uthentication_method\"m\n\017ReceivedMessage\022"
-          + "\016\n\006ack_id\030\001 \001(\t\0220\n\007message\030\002 \001(\0132\037.googl"
-          + "e.pubsub.v1.PubsubMessage\022\030\n\020delivery_at"
-          + "tempt\030\003 \001(\005\"Z\n\026GetSubscriptionRequest\022@\n"
-          + "\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.goog"
-          + "leapis.com/Subscription\"\214\001\n\031UpdateSubscr"
-          + "iptionRequest\0229\n\014subscription\030\001 \001(\0132\036.go"
-          + "ogle.pubsub.v1.SubscriptionB\003\340A\002\0224\n\013upda"
-          + "te_mask\030\002 \001(\0132\032.google.protobuf.FieldMas"
-          + "kB\003\340A\002\"\207\001\n\030ListSubscriptionsRequest\022D\n\007p"
-          + "roject\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanag"
-          + "er.googleapis.com/Project\022\021\n\tpage_size\030\002"
-          + " \001(\005\022\022\n\npage_token\030\003 \001(\t\"k\n\031ListSubscrip"
-          + "tionsResponse\0225\n\rsubscriptions\030\001 \003(\0132\036.g"
-          + "oogle.pubsub.v1.Subscription\022\027\n\017next_pag"
-          + "e_token\030\002 \001(\t\"]\n\031DeleteSubscriptionReque"
+          + ".ExpirationPolicy\022\016\n\006filter\030\014 \001(\t\022>\n\022dea"
+          + "d_letter_policy\030\r \001(\0132\".google.pubsub.v1"
+          + ".DeadLetterPolicy\0223\n\014retry_policy\030\016 \001(\0132"
+          + "\035.google.pubsub.v1.RetryPolicy\032-\n\013Labels"
+          + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:X\352"
+          + "AU\n\"pubsub.googleapis.com/Subscription\022/"
+          + "projects/{project}/subscriptions/{subscr"
+          + "iption}\"u\n\013RetryPolicy\0222\n\017minimum_backof"
+          + "f\030\001 \001(\0132\031.google.protobuf.Duration\0222\n\017ma"
+          + "ximum_backoff\030\002 \001(\0132\031.google.protobuf.Du"
+          + "ration\"L\n\020DeadLetterPolicy\022\031\n\021dead_lette"
+          + "r_topic\030\001 \001(\t\022\035\n\025max_delivery_attempts\030\002"
+          + " \001(\005\":\n\020ExpirationPolicy\022&\n\003ttl\030\001 \001(\0132\031."
+          + "google.protobuf.Duration\"\255\002\n\nPushConfig\022"
+          + "\025\n\rpush_endpoint\030\001 \001(\t\022@\n\nattributes\030\002 \003"
+          + "(\0132,.google.pubsub.v1.PushConfig.Attribu"
+          + "tesEntry\022<\n\noidc_token\030\003 \001(\0132&.google.pu"
+          + "bsub.v1.PushConfig.OidcTokenH\000\032<\n\tOidcTo"
+          + "ken\022\035\n\025service_account_email\030\001 \001(\t\022\020\n\010au"
+          + "dience\030\002 \001(\t\0321\n\017AttributesEntry\022\013\n\003key\030\001"
+          + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\027\n\025authenticatio"
+          + "n_method\"m\n\017ReceivedMessage\022\016\n\006ack_id\030\001 "
+          + "\001(\t\0220\n\007message\030\002 \001(\0132\037.google.pubsub.v1."
+          + "PubsubMessage\022\030\n\020delivery_attempt\030\003 \001(\005\""
+          + "Z\n\026GetSubscriptionRequest\022@\n\014subscriptio"
+          + "n\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googleapis.com/S"
+          + "ubscription\"\214\001\n\031UpdateSubscriptionReques"
+          + "t\0229\n\014subscription\030\001 \001(\0132\036.google.pubsub."
+          + "v1.SubscriptionB\003\340A\002\0224\n\013update_mask\030\002 \001("
+          + "\0132\032.google.protobuf.FieldMaskB\003\340A\002\"\207\001\n\030L"
+          + "istSubscriptionsRequest\022D\n\007project\030\001 \001(\t"
+          + "B3\340A\002\372A-\n+cloudresourcemanager.googleapi"
+          + "s.com/Project\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage"
+          + "_token\030\003 \001(\t\"k\n\031ListSubscriptionsRespons"
+          + "e\0225\n\rsubscriptions\030\001 \003(\0132\036.google.pubsub"
+          + ".v1.Subscription\022\027\n\017next_page_token\030\002 \001("
+          + "\t\"]\n\031DeleteSubscriptionRequest\022@\n\014subscr"
+          + "iption\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googleapis."
+          + "com/Subscription\"\223\001\n\027ModifyPushConfigReq"
+          + "uest\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubs"
+          + "ub.googleapis.com/Subscription\0226\n\013push_c"
+          + "onfig\030\002 \001(\0132\034.google.pubsub.v1.PushConfi"
+          + "gB\003\340A\002\"\215\001\n\013PullRequest\022@\n\014subscription\030\001"
+          + " \001(\tB*\340A\002\372A$\n\"pubsub.googleapis.com/Subs"
+          + "cription\022!\n\022return_immediately\030\002 \001(\010B\005\030\001"
+          + "\340A\001\022\031\n\014max_messages\030\003 \001(\005B\003\340A\002\"L\n\014PullRe"
+          + "sponse\022<\n\021received_messages\030\001 \003(\0132!.goog"
+          + "le.pubsub.v1.ReceivedMessage\"\225\001\n\030ModifyA"
+          + "ckDeadlineRequest\022@\n\014subscription\030\001 \001(\tB"
+          + "*\340A\002\372A$\n\"pubsub.googleapis.com/Subscript"
+          + "ion\022\024\n\007ack_ids\030\004 \003(\tB\003\340A\002\022!\n\024ack_deadlin"
+          + "e_seconds\030\003 \001(\005B\003\340A\002\"l\n\022AcknowledgeReque"
           + "st\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub"
-          + ".googleapis.com/Subscription\"\223\001\n\027ModifyP"
-          + "ushConfigRequest\022@\n\014subscription\030\001 \001(\tB*"
-          + "\340A\002\372A$\n\"pubsub.googleapis.com/Subscripti"
-          + "on\0226\n\013push_config\030\002 \001(\0132\034.google.pubsub."
-          + "v1.PushConfigB\003\340A\002\"\215\001\n\013PullRequest\022@\n\014su"
-          + "bscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googlea"
-          + "pis.com/Subscription\022!\n\022return_immediate"
-          + "ly\030\002 \001(\010B\005\030\001\340A\001\022\031\n\014max_messages\030\003 \001(\005B\003\340"
-          + "A\002\"L\n\014PullResponse\022<\n\021received_messages\030"
-          + "\001 \003(\0132!.google.pubsub.v1.ReceivedMessage"
-          + "\"\225\001\n\030ModifyAckDeadlineRequest\022@\n\014subscri"
-          + "ption\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.googleapis.c"
-          + "om/Subscription\022\024\n\007ack_ids\030\004 \003(\tB\003\340A\002\022!\n"
-          + "\024ack_deadline_seconds\030\003 \001(\005B\003\340A\002\"l\n\022Ackn"
-          + "owledgeRequest\022@\n\014subscription\030\001 \001(\tB*\340A"
-          + "\002\372A$\n\"pubsub.googleapis.com/Subscription"
-          + "\022\024\n\007ack_ids\030\002 \003(\tB\003\340A\002\"\350\001\n\024StreamingPull"
-          + "Request\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"p"
-          + "ubsub.googleapis.com/Subscription\022\017\n\007ack"
-          + "_ids\030\002 \003(\t\022\037\n\027modify_deadline_seconds\030\003 "
-          + "\003(\005\022\037\n\027modify_deadline_ack_ids\030\004 \003(\t\022(\n\033"
-          + "stream_ack_deadline_seconds\030\005 \001(\005B\003\340A\002\022\021"
-          + "\n\tclient_id\030\006 \001(\t\"U\n\025StreamingPullRespon"
-          + "se\022<\n\021received_messages\030\001 \003(\0132!.google.p"
-          + "ubsub.v1.ReceivedMessage\"\203\002\n\025CreateSnaps"
-          + "hotRequest\0224\n\004name\030\001 \001(\tB&\340A\002\372A \n\036pubsub"
-          + ".googleapis.com/Snapshot\022@\n\014subscription"
-          + "\030\002 \001(\tB*\340A\002\372A$\n\"pubsub.googleapis.com/Su"
-          + "bscription\022C\n\006labels\030\003 \003(\01323.google.pubs"
-          + "ub.v1.CreateSnapshotRequest.LabelsEntry\032"
-          + "-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001"
-          + "(\t:\0028\001\"\200\001\n\025UpdateSnapshotRequest\0221\n\010snap"
-          + "shot\030\001 \001(\0132\032.google.pubsub.v1.SnapshotB\003"
-          + "\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.protob"
-          + "uf.FieldMaskB\003\340A\002\"\257\002\n\010Snapshot\022\014\n\004name\030\001"
-          + " \001(\t\022/\n\005topic\030\002 \001(\tB \372A\035\n\033pubsub.googlea"
-          + "pis.com/Topic\022/\n\013expire_time\030\003 \001(\0132\032.goo"
-          + "gle.protobuf.Timestamp\0226\n\006labels\030\004 \003(\0132&"
-          + ".google.pubsub.v1.Snapshot.LabelsEntry\032-"
-          + "\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001("
-          + "\t:\0028\001:L\352AI\n\036pubsub.googleapis.com/Snapsh"
-          + "ot\022\'projects/{project}/snapshots/{snapsh"
-          + "ot}\"N\n\022GetSnapshotRequest\0228\n\010snapshot\030\001 "
-          + "\001(\tB&\340A\002\372A \n\036pubsub.googleapis.com/Snaps"
-          + "hot\"\203\001\n\024ListSnapshotsRequest\022D\n\007project\030"
-          + "\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager.goog"
-          + "leapis.com/Project\022\021\n\tpage_size\030\002 \001(\005\022\022\n"
-          + "\npage_token\030\003 \001(\t\"_\n\025ListSnapshotsRespon"
-          + "se\022-\n\tsnapshots\030\001 \003(\0132\032.google.pubsub.v1"
-          + ".Snapshot\022\027\n\017next_page_token\030\002 \001(\t\"Q\n\025De"
-          + "leteSnapshotRequest\0228\n\010snapshot\030\001 \001(\tB&\340"
-          + "A\002\372A \n\036pubsub.googleapis.com/Snapshot\"\276\001"
-          + "\n\013SeekRequest\022@\n\014subscription\030\001 \001(\tB*\340A\002"
-          + "\372A$\n\"pubsub.googleapis.com/Subscription\022"
-          + "*\n\004time\030\002 \001(\0132\032.google.protobuf.Timestam"
-          + "pH\000\0227\n\010snapshot\030\003 \001(\tB#\372A \n\036pubsub.googl"
-          + "eapis.com/SnapshotH\000B\010\n\006target\"\016\n\014SeekRe"
-          + "sponse2\363\t\n\tPublisher\022q\n\013CreateTopic\022\027.go"
-          + "ogle.pubsub.v1.Topic\032\027.google.pubsub.v1."
-          + "Topic\"0\202\323\344\223\002#\032\036/v1/{name=projects/*/topi"
-          + "cs/*}:\001*\332A\004name\022}\n\013UpdateTopic\022$.google."
-          + "pubsub.v1.UpdateTopicRequest\032\027.google.pu"
-          + "bsub.v1.Topic\"/\202\323\344\223\002)2$/v1/{topic.name=p"
-          + "rojects/*/topics/*}:\001*\022\223\001\n\007Publish\022 .goo"
-          + "gle.pubsub.v1.PublishRequest\032!.google.pu"
-          + "bsub.v1.PublishResponse\"C\202\323\344\223\002,\"\'/v1/{to"
-          + "pic=projects/*/topics/*}:publish:\001*\332A\016to"
-          + "pic,messages\022w\n\010GetTopic\022!.google.pubsub"
-          + ".v1.GetTopicRequest\032\027.google.pubsub.v1.T"
-          + "opic\"/\202\323\344\223\002!\022\037/v1/{topic=projects/*/topi"
-          + "cs/*}\332A\005topic\022\212\001\n\nListTopics\022#.google.pu"
-          + "bsub.v1.ListTopicsRequest\032$.google.pubsu"
-          + "b.v1.ListTopicsResponse\"1\202\323\344\223\002!\022\037/v1/{pr"
-          + "oject=projects/*}/topics\332A\007project\022\272\001\n\026L"
-          + "istTopicSubscriptions\022/.google.pubsub.v1"
-          + ".ListTopicSubscriptionsRequest\0320.google."
-          + "pubsub.v1.ListTopicSubscriptionsResponse"
-          + "\"=\202\323\344\223\002/\022-/v1/{topic=projects/*/topics/*"
-          + "}/subscriptions\332A\005topic\022\252\001\n\022ListTopicSna"
-          + "pshots\022+.google.pubsub.v1.ListTopicSnaps"
-          + "hotsRequest\032,.google.pubsub.v1.ListTopic"
-          + "SnapshotsResponse\"9\202\323\344\223\002+\022)/v1/{topic=pr"
-          + "ojects/*/topics/*}/snapshots\332A\005topic\022|\n\013"
-          + "DeleteTopic\022$.google.pubsub.v1.DeleteTop"
-          + "icRequest\032\026.google.protobuf.Empty\"/\202\323\344\223\002"
-          + "!*\037/v1/{topic=projects/*/topics/*}\332A\005top"
-          + "ic\032p\312A\025pubsub.googleapis.com\322AUhttps://w"
-          + "ww.googleapis.com/auth/cloud-platform,ht"
-          + "tps://www.googleapis.com/auth/pubsub2\203\025\n"
-          + "\nSubscriber\022\264\001\n\022CreateSubscription\022\036.goo"
-          + "gle.pubsub.v1.Subscription\032\036.google.pubs"
-          + "ub.v1.Subscription\"^\202\323\344\223\002*\032%/v1/{name=pr"
-          + "ojects/*/subscriptions/*}:\001*\332A+name,topi"
-          + "c,push_config,ack_deadline_seconds\022\241\001\n\017G"
-          + "etSubscription\022(.google.pubsub.v1.GetSub"
-          + "scriptionRequest\032\036.google.pubsub.v1.Subs"
-          + "cription\"D\202\323\344\223\002/\022-/v1/{subscription=proj"
-          + "ects/*/subscriptions/*}\332A\014subscription\022\240"
-          + "\001\n\022UpdateSubscription\022+.google.pubsub.v1"
-          + ".UpdateSubscriptionRequest\032\036.google.pubs"
-          + "ub.v1.Subscription\"=\202\323\344\223\002722/v1/{subscri"
-          + "ption.name=projects/*/subscriptions/*}:\001"
-          + "*\022\246\001\n\021ListSubscriptions\022*.google.pubsub."
-          + "v1.ListSubscriptionsRequest\032+.google.pub"
-          + "sub.v1.ListSubscriptionsResponse\"8\202\323\344\223\002("
-          + "\022&/v1/{project=projects/*}/subscriptions"
-          + "\332A\007project\022\237\001\n\022DeleteSubscription\022+.goog"
-          + "le.pubsub.v1.DeleteSubscriptionRequest\032\026"
-          + ".google.protobuf.Empty\"D\202\323\344\223\002/*-/v1/{sub"
-          + "scription=projects/*/subscriptions/*}\332A\014"
-          + "subscription\022\317\001\n\021ModifyAckDeadline\022*.goo"
-          + "gle.pubsub.v1.ModifyAckDeadlineRequest\032\026"
-          + ".google.protobuf.Empty\"v\202\323\344\223\002D\"?/v1/{sub"
-          + "scription=projects/*/subscriptions/*}:mo"
-          + "difyAckDeadline:\001*\332A)subscription,ack_id"
-          + "s,ack_deadline_seconds\022\250\001\n\013Acknowledge\022$"
-          + ".google.pubsub.v1.AcknowledgeRequest\032\026.g"
-          + "oogle.protobuf.Empty\"[\202\323\344\223\002>\"9/v1/{subsc"
-          + "ription=projects/*/subscriptions/*}:ackn"
-          + "owledge:\001*\332A\024subscription,ack_ids\022\263\001\n\004Pu"
-          + "ll\022\035.google.pubsub.v1.PullRequest\032\036.goog"
-          + "le.pubsub.v1.PullResponse\"l\202\323\344\223\0027\"2/v1/{"
-          + "subscription=projects/*/subscriptions/*}"
-          + ":pull:\001*\332A,subscription,return_immediate"
-          + "ly,max_messages\022f\n\rStreamingPull\022&.googl"
-          + "e.pubsub.v1.StreamingPullRequest\032\'.googl"
-          + "e.pubsub.v1.StreamingPullResponse\"\000(\0010\001\022"
-          + "\273\001\n\020ModifyPushConfig\022).google.pubsub.v1."
-          + "ModifyPushConfigRequest\032\026.google.protobu"
-          + "f.Empty\"d\202\323\344\223\002C\">/v1/{subscription=proje"
-          + "cts/*/subscriptions/*}:modifyPushConfig:"
-          + "\001*\332A\030subscription,push_config\022\211\001\n\013GetSna"
-          + "pshot\022$.google.pubsub.v1.GetSnapshotRequ"
-          + "est\032\032.google.pubsub.v1.Snapshot\"8\202\323\344\223\002\'\022"
-          + "%/v1/{snapshot=projects/*/snapshots/*}\332A"
-          + "\010snapshot\022\226\001\n\rListSnapshots\022&.google.pub"
-          + "sub.v1.ListSnapshotsRequest\032\'.google.pub"
-          + "sub.v1.ListSnapshotsResponse\"4\202\323\344\223\002$\022\"/v"
-          + "1/{project=projects/*}/snapshots\332A\007proje"
-          + "ct\022\227\001\n\016CreateSnapshot\022\'.google.pubsub.v1"
-          + ".CreateSnapshotRequest\032\032.google.pubsub.v"
-          + "1.Snapshot\"@\202\323\344\223\002&\032!/v1/{name=projects/*"
-          + "/snapshots/*}:\001*\332A\021name,subscription\022\214\001\n"
-          + "\016UpdateSnapshot\022\'.google.pubsub.v1.Updat"
-          + "eSnapshotRequest\032\032.google.pubsub.v1.Snap"
-          + "shot\"5\202\323\344\223\002/2*/v1/{snapshot.name=project"
-          + "s/*/snapshots/*}:\001*\022\213\001\n\016DeleteSnapshot\022\'"
-          + ".google.pubsub.v1.DeleteSnapshotRequest\032"
-          + "\026.google.protobuf.Empty\"8\202\323\344\223\002\'*%/v1/{sn"
-          + "apshot=projects/*/snapshots/*}\332A\010snapsho"
-          + "t\022\204\001\n\004Seek\022\035.google.pubsub.v1.SeekReques"
-          + "t\032\036.google.pubsub.v1.SeekResponse\"=\202\323\344\223\002"
-          + "7\"2/v1/{subscription=projects/*/subscrip"
-          + "tions/*}:seek:\001*\032p\312A\025pubsub.googleapis.c"
-          + "om\322AUhttps://www.googleapis.com/auth/clo"
-          + "ud-platform,https://www.googleapis.com/a"
-          + "uth/pubsubB\256\001\n\024com.google.pubsub.v1B\013Pub"
-          + "subProtoP\001Z6google.golang.org/genproto/g"
-          + "oogleapis/pubsub/v1;pubsub\370\001\001\252\002\026Google.C"
-          + "loud.PubSub.V1\312\002\026Google\\Cloud\\PubSub\\V1\352"
-          + "\002\031Google::Cloud::PubSub::V1b\006proto3"
+          + ".googleapis.com/Subscription\022\024\n\007ack_ids\030"
+          + "\002 \003(\tB\003\340A\002\"\350\001\n\024StreamingPullRequest\022@\n\014s"
+          + "ubscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub.google"
+          + "apis.com/Subscription\022\017\n\007ack_ids\030\002 \003(\t\022\037"
+          + "\n\027modify_deadline_seconds\030\003 \003(\005\022\037\n\027modif"
+          + "y_deadline_ack_ids\030\004 \003(\t\022(\n\033stream_ack_d"
+          + "eadline_seconds\030\005 \001(\005B\003\340A\002\022\021\n\tclient_id\030"
+          + "\006 \001(\t\"U\n\025StreamingPullResponse\022<\n\021receiv"
+          + "ed_messages\030\001 \003(\0132!.google.pubsub.v1.Rec"
+          + "eivedMessage\"\203\002\n\025CreateSnapshotRequest\0224"
+          + "\n\004name\030\001 \001(\tB&\340A\002\372A \n\036pubsub.googleapis."
+          + "com/Snapshot\022@\n\014subscription\030\002 \001(\tB*\340A\002\372"
+          + "A$\n\"pubsub.googleapis.com/Subscription\022C"
+          + "\n\006labels\030\003 \003(\01323.google.pubsub.v1.Create"
+          + "SnapshotRequest.LabelsEntry\032-\n\013LabelsEnt"
+          + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\200\001\n\025U"
+          + "pdateSnapshotRequest\0221\n\010snapshot\030\001 \001(\0132\032"
+          + ".google.pubsub.v1.SnapshotB\003\340A\002\0224\n\013updat"
+          + "e_mask\030\002 \001(\0132\032.google.protobuf.FieldMask"
+          + "B\003\340A\002\"\257\002\n\010Snapshot\022\014\n\004name\030\001 \001(\t\022/\n\005topi"
+          + "c\030\002 \001(\tB \372A\035\n\033pubsub.googleapis.com/Topi"
+          + "c\022/\n\013expire_time\030\003 \001(\0132\032.google.protobuf"
+          + ".Timestamp\0226\n\006labels\030\004 \003(\0132&.google.pubs"
+          + "ub.v1.Snapshot.LabelsEntry\032-\n\013LabelsEntr"
+          + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:L\352AI\n\036"
+          + "pubsub.googleapis.com/Snapshot\022\'projects"
+          + "/{project}/snapshots/{snapshot}\"N\n\022GetSn"
+          + "apshotRequest\0228\n\010snapshot\030\001 \001(\tB&\340A\002\372A \n"
+          + "\036pubsub.googleapis.com/Snapshot\"\203\001\n\024List"
+          + "SnapshotsRequest\022D\n\007project\030\001 \001(\tB3\340A\002\372A"
+          + "-\n+cloudresourcemanager.googleapis.com/P"
+          + "roject\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030"
+          + "\003 \001(\t\"_\n\025ListSnapshotsResponse\022-\n\tsnapsh"
+          + "ots\030\001 \003(\0132\032.google.pubsub.v1.Snapshot\022\027\n"
+          + "\017next_page_token\030\002 \001(\t\"Q\n\025DeleteSnapshot"
+          + "Request\0228\n\010snapshot\030\001 \001(\tB&\340A\002\372A \n\036pubsu"
+          + "b.googleapis.com/Snapshot\"\276\001\n\013SeekReques"
+          + "t\022@\n\014subscription\030\001 \001(\tB*\340A\002\372A$\n\"pubsub."
+          + "googleapis.com/Subscription\022*\n\004time\030\002 \001("
+          + "\0132\032.google.protobuf.TimestampH\000\0227\n\010snaps"
+          + "hot\030\003 \001(\tB#\372A \n\036pubsub.googleapis.com/Sn"
+          + "apshotH\000B\010\n\006target\"\016\n\014SeekResponse2\363\t\n\tP"
+          + "ublisher\022q\n\013CreateTopic\022\027.google.pubsub."
+          + "v1.Topic\032\027.google.pubsub.v1.Topic\"0\202\323\344\223\002"
+          + "#\032\036/v1/{name=projects/*/topics/*}:\001*\332A\004n"
+          + "ame\022}\n\013UpdateTopic\022$.google.pubsub.v1.Up"
+          + "dateTopicRequest\032\027.google.pubsub.v1.Topi"
+          + "c\"/\202\323\344\223\002)2$/v1/{topic.name=projects/*/to"
+          + "pics/*}:\001*\022\223\001\n\007Publish\022 .google.pubsub.v"
+          + "1.PublishRequest\032!.google.pubsub.v1.Publ"
+          + "ishResponse\"C\202\323\344\223\002,\"\'/v1/{topic=projects"
+          + "/*/topics/*}:publish:\001*\332A\016topic,messages"
+          + "\022w\n\010GetTopic\022!.google.pubsub.v1.GetTopic"
+          + "Request\032\027.google.pubsub.v1.Topic\"/\202\323\344\223\002!"
+          + "\022\037/v1/{topic=projects/*/topics/*}\332A\005topi"
+          + "c\022\212\001\n\nListTopics\022#.google.pubsub.v1.List"
+          + "TopicsRequest\032$.google.pubsub.v1.ListTop"
+          + "icsResponse\"1\202\323\344\223\002!\022\037/v1/{project=projec"
+          + "ts/*}/topics\332A\007project\022\272\001\n\026ListTopicSubs"
+          + "criptions\022/.google.pubsub.v1.ListTopicSu"
+          + "bscriptionsRequest\0320.google.pubsub.v1.Li"
+          + "stTopicSubscriptionsResponse\"=\202\323\344\223\002/\022-/v"
+          + "1/{topic=projects/*/topics/*}/subscripti"
+          + "ons\332A\005topic\022\252\001\n\022ListTopicSnapshots\022+.goo"
+          + "gle.pubsub.v1.ListTopicSnapshotsRequest\032"
+          + ",.google.pubsub.v1.ListTopicSnapshotsRes"
+          + "ponse\"9\202\323\344\223\002+\022)/v1/{topic=projects/*/top"
+          + "ics/*}/snapshots\332A\005topic\022|\n\013DeleteTopic\022"
+          + "$.google.pubsub.v1.DeleteTopicRequest\032\026."
+          + "google.protobuf.Empty\"/\202\323\344\223\002!*\037/v1/{topi"
+          + "c=projects/*/topics/*}\332A\005topic\032p\312A\025pubsu"
+          + "b.googleapis.com\322AUhttps://www.googleapi"
+          + "s.com/auth/cloud-platform,https://www.go"
+          + "ogleapis.com/auth/pubsub2\203\025\n\nSubscriber\022"
+          + "\264\001\n\022CreateSubscription\022\036.google.pubsub.v"
+          + "1.Subscription\032\036.google.pubsub.v1.Subscr"
+          + "iption\"^\202\323\344\223\002*\032%/v1/{name=projects/*/sub"
+          + "scriptions/*}:\001*\332A+name,topic,push_confi"
+          + "g,ack_deadline_seconds\022\241\001\n\017GetSubscripti"
+          + "on\022(.google.pubsub.v1.GetSubscriptionReq"
+          + "uest\032\036.google.pubsub.v1.Subscription\"D\202\323"
+          + "\344\223\002/\022-/v1/{subscription=projects/*/subsc"
+          + "riptions/*}\332A\014subscription\022\240\001\n\022UpdateSub"
+          + "scription\022+.google.pubsub.v1.UpdateSubsc"
+          + "riptionRequest\032\036.google.pubsub.v1.Subscr"
+          + "iption\"=\202\323\344\223\002722/v1/{subscription.name=p"
+          + "rojects/*/subscriptions/*}:\001*\022\246\001\n\021ListSu"
+          + "bscriptions\022*.google.pubsub.v1.ListSubsc"
+          + "riptionsRequest\032+.google.pubsub.v1.ListS"
+          + "ubscriptionsResponse\"8\202\323\344\223\002(\022&/v1/{proje"
+          + "ct=projects/*}/subscriptions\332A\007project\022\237"
+          + "\001\n\022DeleteSubscription\022+.google.pubsub.v1"
+          + ".DeleteSubscriptionRequest\032\026.google.prot"
+          + "obuf.Empty\"D\202\323\344\223\002/*-/v1/{subscription=pr"
+          + "ojects/*/subscriptions/*}\332A\014subscription"
+          + "\022\317\001\n\021ModifyAckDeadline\022*.google.pubsub.v"
+          + "1.ModifyAckDeadlineRequest\032\026.google.prot"
+          + "obuf.Empty\"v\202\323\344\223\002D\"?/v1/{subscription=pr"
+          + "ojects/*/subscriptions/*}:modifyAckDeadl"
+          + "ine:\001*\332A)subscription,ack_ids,ack_deadli"
+          + "ne_seconds\022\250\001\n\013Acknowledge\022$.google.pubs"
+          + "ub.v1.AcknowledgeRequest\032\026.google.protob"
+          + "uf.Empty\"[\202\323\344\223\002>\"9/v1/{subscription=proj"
+          + "ects/*/subscriptions/*}:acknowledge:\001*\332A"
+          + "\024subscription,ack_ids\022\263\001\n\004Pull\022\035.google."
+          + "pubsub.v1.PullRequest\032\036.google.pubsub.v1"
+          + ".PullResponse\"l\202\323\344\223\0027\"2/v1/{subscription"
+          + "=projects/*/subscriptions/*}:pull:\001*\332A,s"
+          + "ubscription,return_immediately,max_messa"
+          + "ges\022f\n\rStreamingPull\022&.google.pubsub.v1."
+          + "StreamingPullRequest\032\'.google.pubsub.v1."
+          + "StreamingPullResponse\"\000(\0010\001\022\273\001\n\020ModifyPu"
+          + "shConfig\022).google.pubsub.v1.ModifyPushCo"
+          + "nfigRequest\032\026.google.protobuf.Empty\"d\202\323\344"
+          + "\223\002C\">/v1/{subscription=projects/*/subscr"
+          + "iptions/*}:modifyPushConfig:\001*\332A\030subscri"
+          + "ption,push_config\022\211\001\n\013GetSnapshot\022$.goog"
+          + "le.pubsub.v1.GetSnapshotRequest\032\032.google"
+          + ".pubsub.v1.Snapshot\"8\202\323\344\223\002\'\022%/v1/{snapsh"
+          + "ot=projects/*/snapshots/*}\332A\010snapshot\022\226\001"
+          + "\n\rListSnapshots\022&.google.pubsub.v1.ListS"
+          + "napshotsRequest\032\'.google.pubsub.v1.ListS"
+          + "napshotsResponse\"4\202\323\344\223\002$\022\"/v1/{project=p"
+          + "rojects/*}/snapshots\332A\007project\022\227\001\n\016Creat"
+          + "eSnapshot\022\'.google.pubsub.v1.CreateSnaps"
+          + "hotRequest\032\032.google.pubsub.v1.Snapshot\"@"
+          + "\202\323\344\223\002&\032!/v1/{name=projects/*/snapshots/*"
+          + "}:\001*\332A\021name,subscription\022\214\001\n\016UpdateSnaps"
+          + "hot\022\'.google.pubsub.v1.UpdateSnapshotReq"
+          + "uest\032\032.google.pubsub.v1.Snapshot\"5\202\323\344\223\002/"
+          + "2*/v1/{snapshot.name=projects/*/snapshot"
+          + "s/*}:\001*\022\213\001\n\016DeleteSnapshot\022\'.google.pubs"
+          + "ub.v1.DeleteSnapshotRequest\032\026.google.pro"
+          + "tobuf.Empty\"8\202\323\344\223\002\'*%/v1/{snapshot=proje"
+          + "cts/*/snapshots/*}\332A\010snapshot\022\204\001\n\004Seek\022\035"
+          + ".google.pubsub.v1.SeekRequest\032\036.google.p"
+          + "ubsub.v1.SeekResponse\"=\202\323\344\223\0027\"2/v1/{subs"
+          + "cription=projects/*/subscriptions/*}:see"
+          + "k:\001*\032p\312A\025pubsub.googleapis.com\322AUhttps:/"
+          + "/www.googleapis.com/auth/cloud-platform,"
+          + "https://www.googleapis.com/auth/pubsubB\256"
+          + "\001\n\024com.google.pubsub.v1B\013PubsubProtoP\001Z6"
+          + "google.golang.org/genproto/googleapis/pu"
+          + "bsub/v1;pubsub\370\001\001\252\002\026Google.Cloud.PubSub."
+          + "V1\312\002\026Google\\Cloud\\PubSub\\V1\352\002\031Google::Cl"
+          + "oud::PubSub::V1b\006proto3"
     };
     descriptor =
         com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -634,7 +643,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Labels",
               "EnableMessageOrdering",
               "ExpirationPolicy",
+              "Filter",
               "DeadLetterPolicy",
+              "RetryPolicy",
             });
     internal_static_google_pubsub_v1_Subscription_LabelsEntry_descriptor =
         internal_static_google_pubsub_v1_Subscription_descriptor.getNestedTypes().get(0);
@@ -644,8 +655,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
             new java.lang.String[] {
               "Key", "Value",
             });
-    internal_static_google_pubsub_v1_DeadLetterPolicy_descriptor =
+    internal_static_google_pubsub_v1_RetryPolicy_descriptor =
         getDescriptor().getMessageTypes().get(15);
+    internal_static_google_pubsub_v1_RetryPolicy_fieldAccessorTable =
+        new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+            internal_static_google_pubsub_v1_RetryPolicy_descriptor,
+            new java.lang.String[] {
+              "MinimumBackoff", "MaximumBackoff",
+            });
+    internal_static_google_pubsub_v1_DeadLetterPolicy_descriptor =
+        getDescriptor().getMessageTypes().get(16);
     internal_static_google_pubsub_v1_DeadLetterPolicy_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_DeadLetterPolicy_descriptor,
@@ -653,7 +672,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "DeadLetterTopic", "MaxDeliveryAttempts",
             });
     internal_static_google_pubsub_v1_ExpirationPolicy_descriptor =
-        getDescriptor().getMessageTypes().get(16);
+        getDescriptor().getMessageTypes().get(17);
     internal_static_google_pubsub_v1_ExpirationPolicy_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_ExpirationPolicy_descriptor,
@@ -661,7 +680,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Ttl",
             });
     internal_static_google_pubsub_v1_PushConfig_descriptor =
-        getDescriptor().getMessageTypes().get(17);
+        getDescriptor().getMessageTypes().get(18);
     internal_static_google_pubsub_v1_PushConfig_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_PushConfig_descriptor,
@@ -685,7 +704,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Key", "Value",
             });
     internal_static_google_pubsub_v1_ReceivedMessage_descriptor =
-        getDescriptor().getMessageTypes().get(18);
+        getDescriptor().getMessageTypes().get(19);
     internal_static_google_pubsub_v1_ReceivedMessage_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_ReceivedMessage_descriptor,
@@ -693,7 +712,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "AckId", "Message", "DeliveryAttempt",
             });
     internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor =
-        getDescriptor().getMessageTypes().get(19);
+        getDescriptor().getMessageTypes().get(20);
     internal_static_google_pubsub_v1_GetSubscriptionRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_GetSubscriptionRequest_descriptor,
@@ -701,7 +720,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Subscription",
             });
     internal_static_google_pubsub_v1_UpdateSubscriptionRequest_descriptor =
-        getDescriptor().getMessageTypes().get(20);
+        getDescriptor().getMessageTypes().get(21);
     internal_static_google_pubsub_v1_UpdateSubscriptionRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_UpdateSubscriptionRequest_descriptor,
@@ -709,7 +728,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Subscription", "UpdateMask",
             });
     internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor =
-        getDescriptor().getMessageTypes().get(21);
+        getDescriptor().getMessageTypes().get(22);
     internal_static_google_pubsub_v1_ListSubscriptionsRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_ListSubscriptionsRequest_descriptor,
@@ -717,7 +736,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Project", "PageSize", "PageToken",
             });
     internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor =
-        getDescriptor().getMessageTypes().get(22);
+        getDescriptor().getMessageTypes().get(23);
     internal_static_google_pubsub_v1_ListSubscriptionsResponse_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_ListSubscriptionsResponse_descriptor,
@@ -725,7 +744,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Subscriptions", "NextPageToken",
             });
     internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor =
-        getDescriptor().getMessageTypes().get(23);
+        getDescriptor().getMessageTypes().get(24);
     internal_static_google_pubsub_v1_DeleteSubscriptionRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_DeleteSubscriptionRequest_descriptor,
@@ -733,7 +752,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Subscription",
             });
     internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor =
-        getDescriptor().getMessageTypes().get(24);
+        getDescriptor().getMessageTypes().get(25);
     internal_static_google_pubsub_v1_ModifyPushConfigRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_ModifyPushConfigRequest_descriptor,
@@ -741,7 +760,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Subscription", "PushConfig",
             });
     internal_static_google_pubsub_v1_PullRequest_descriptor =
-        getDescriptor().getMessageTypes().get(25);
+        getDescriptor().getMessageTypes().get(26);
     internal_static_google_pubsub_v1_PullRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_PullRequest_descriptor,
@@ -749,7 +768,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Subscription", "ReturnImmediately", "MaxMessages",
             });
     internal_static_google_pubsub_v1_PullResponse_descriptor =
-        getDescriptor().getMessageTypes().get(26);
+        getDescriptor().getMessageTypes().get(27);
     internal_static_google_pubsub_v1_PullResponse_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_PullResponse_descriptor,
@@ -757,7 +776,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "ReceivedMessages",
             });
     internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor =
-        getDescriptor().getMessageTypes().get(27);
+        getDescriptor().getMessageTypes().get(28);
     internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_ModifyAckDeadlineRequest_descriptor,
@@ -765,7 +784,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Subscription", "AckIds", "AckDeadlineSeconds",
             });
     internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor =
-        getDescriptor().getMessageTypes().get(28);
+        getDescriptor().getMessageTypes().get(29);
     internal_static_google_pubsub_v1_AcknowledgeRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_AcknowledgeRequest_descriptor,
@@ -773,7 +792,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Subscription", "AckIds",
             });
     internal_static_google_pubsub_v1_StreamingPullRequest_descriptor =
-        getDescriptor().getMessageTypes().get(29);
+        getDescriptor().getMessageTypes().get(30);
     internal_static_google_pubsub_v1_StreamingPullRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_StreamingPullRequest_descriptor,
@@ -786,7 +805,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "ClientId",
             });
     internal_static_google_pubsub_v1_StreamingPullResponse_descriptor =
-        getDescriptor().getMessageTypes().get(30);
+        getDescriptor().getMessageTypes().get(31);
     internal_static_google_pubsub_v1_StreamingPullResponse_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_StreamingPullResponse_descriptor,
@@ -794,7 +813,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "ReceivedMessages",
             });
     internal_static_google_pubsub_v1_CreateSnapshotRequest_descriptor =
-        getDescriptor().getMessageTypes().get(31);
+        getDescriptor().getMessageTypes().get(32);
     internal_static_google_pubsub_v1_CreateSnapshotRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_CreateSnapshotRequest_descriptor,
@@ -810,7 +829,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Key", "Value",
             });
     internal_static_google_pubsub_v1_UpdateSnapshotRequest_descriptor =
-        getDescriptor().getMessageTypes().get(32);
+        getDescriptor().getMessageTypes().get(33);
     internal_static_google_pubsub_v1_UpdateSnapshotRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_UpdateSnapshotRequest_descriptor,
@@ -818,7 +837,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Snapshot", "UpdateMask",
             });
     internal_static_google_pubsub_v1_Snapshot_descriptor =
-        getDescriptor().getMessageTypes().get(33);
+        getDescriptor().getMessageTypes().get(34);
     internal_static_google_pubsub_v1_Snapshot_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_Snapshot_descriptor,
@@ -834,7 +853,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Key", "Value",
             });
     internal_static_google_pubsub_v1_GetSnapshotRequest_descriptor =
-        getDescriptor().getMessageTypes().get(34);
+        getDescriptor().getMessageTypes().get(35);
     internal_static_google_pubsub_v1_GetSnapshotRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_GetSnapshotRequest_descriptor,
@@ -842,7 +861,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Snapshot",
             });
     internal_static_google_pubsub_v1_ListSnapshotsRequest_descriptor =
-        getDescriptor().getMessageTypes().get(35);
+        getDescriptor().getMessageTypes().get(36);
     internal_static_google_pubsub_v1_ListSnapshotsRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_ListSnapshotsRequest_descriptor,
@@ -850,7 +869,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Project", "PageSize", "PageToken",
             });
     internal_static_google_pubsub_v1_ListSnapshotsResponse_descriptor =
-        getDescriptor().getMessageTypes().get(36);
+        getDescriptor().getMessageTypes().get(37);
     internal_static_google_pubsub_v1_ListSnapshotsResponse_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_ListSnapshotsResponse_descriptor,
@@ -858,7 +877,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Snapshots", "NextPageToken",
             });
     internal_static_google_pubsub_v1_DeleteSnapshotRequest_descriptor =
-        getDescriptor().getMessageTypes().get(37);
+        getDescriptor().getMessageTypes().get(38);
     internal_static_google_pubsub_v1_DeleteSnapshotRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_DeleteSnapshotRequest_descriptor,
@@ -866,7 +885,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Snapshot",
             });
     internal_static_google_pubsub_v1_SeekRequest_descriptor =
-        getDescriptor().getMessageTypes().get(38);
+        getDescriptor().getMessageTypes().get(39);
     internal_static_google_pubsub_v1_SeekRequest_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_SeekRequest_descriptor,
@@ -874,7 +893,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               "Subscription", "Time", "Snapshot", "Target",
             });
     internal_static_google_pubsub_v1_SeekResponse_descriptor =
-        getDescriptor().getMessageTypes().get(39);
+        getDescriptor().getMessageTypes().get(40);
     internal_static_google_pubsub_v1_SeekResponse_fieldAccessorTable =
         new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
             internal_static_google_pubsub_v1_SeekResponse_descriptor, new java.lang.String[] {});
diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicy.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicy.java
new file mode 100644
index 000000000..4d7f081ea
--- /dev/null
+++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicy.java
@@ -0,0 +1,1033 @@
+/*
+ * Copyright 2020 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/pubsub/v1/pubsub.proto
+
+package com.google.pubsub.v1;
+
+/**
+ *
+ *
+ * 
+ * A policy that specifies how Cloud Pub/Sub retries message delivery.
+ * Retry delay will be exponential based on provided minimum and maximum
+ * backoffs. https://en.wikipedia.org/wiki/Exponential_backoff.
+ * RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded
+ * events for a given message.
+ * Retry Policy is implemented on a best effort basis. At times, the delay
+ * between consecutive deliveries may not match the configuration. That is,
+ * delay can be more or less than configured backoff.
+ * 
+ * + * Protobuf type {@code google.pubsub.v1.RetryPolicy} + */ +public final class RetryPolicy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.pubsub.v1.RetryPolicy) + RetryPolicyOrBuilder { + private static final long serialVersionUID = 0L; + // Use RetryPolicy.newBuilder() to construct. + private RetryPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RetryPolicy() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RetryPolicy(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RetryPolicy( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (minimumBackoff_ != null) { + subBuilder = minimumBackoff_.toBuilder(); + } + minimumBackoff_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(minimumBackoff_); + minimumBackoff_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (maximumBackoff_ != null) { + subBuilder = maximumBackoff_.toBuilder(); + } + maximumBackoff_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(maximumBackoff_); + maximumBackoff_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.PubsubProto.internal_static_google_pubsub_v1_RetryPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto + .internal_static_google_pubsub_v1_RetryPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.RetryPolicy.class, com.google.pubsub.v1.RetryPolicy.Builder.class); + } + + public static final int MINIMUM_BACKOFF_FIELD_NUMBER = 1; + private com.google.protobuf.Duration minimumBackoff_; + /** + * + * + *
+   * The minimum delay between consecutive deliveries of a given message.
+   * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+   * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + * + * @return Whether the minimumBackoff field is set. + */ + public boolean hasMinimumBackoff() { + return minimumBackoff_ != null; + } + /** + * + * + *
+   * The minimum delay between consecutive deliveries of a given message.
+   * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+   * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + * + * @return The minimumBackoff. + */ + public com.google.protobuf.Duration getMinimumBackoff() { + return minimumBackoff_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minimumBackoff_; + } + /** + * + * + *
+   * The minimum delay between consecutive deliveries of a given message.
+   * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+   * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + */ + public com.google.protobuf.DurationOrBuilder getMinimumBackoffOrBuilder() { + return getMinimumBackoff(); + } + + public static final int MAXIMUM_BACKOFF_FIELD_NUMBER = 2; + private com.google.protobuf.Duration maximumBackoff_; + /** + * + * + *
+   * The maximum delay between consecutive deliveries of a given message.
+   * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+   * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + * + * @return Whether the maximumBackoff field is set. + */ + public boolean hasMaximumBackoff() { + return maximumBackoff_ != null; + } + /** + * + * + *
+   * The maximum delay between consecutive deliveries of a given message.
+   * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+   * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + * + * @return The maximumBackoff. + */ + public com.google.protobuf.Duration getMaximumBackoff() { + return maximumBackoff_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : maximumBackoff_; + } + /** + * + * + *
+   * The maximum delay between consecutive deliveries of a given message.
+   * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+   * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + */ + public com.google.protobuf.DurationOrBuilder getMaximumBackoffOrBuilder() { + return getMaximumBackoff(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (minimumBackoff_ != null) { + output.writeMessage(1, getMinimumBackoff()); + } + if (maximumBackoff_ != null) { + output.writeMessage(2, getMaximumBackoff()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (minimumBackoff_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMinimumBackoff()); + } + if (maximumBackoff_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMaximumBackoff()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.pubsub.v1.RetryPolicy)) { + return super.equals(obj); + } + com.google.pubsub.v1.RetryPolicy other = (com.google.pubsub.v1.RetryPolicy) obj; + + if (hasMinimumBackoff() != other.hasMinimumBackoff()) return false; + if (hasMinimumBackoff()) { + if (!getMinimumBackoff().equals(other.getMinimumBackoff())) return false; + } + if (hasMaximumBackoff() != other.hasMaximumBackoff()) return false; + if (hasMaximumBackoff()) { + if (!getMaximumBackoff().equals(other.getMaximumBackoff())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasMinimumBackoff()) { + hash = (37 * hash) + MINIMUM_BACKOFF_FIELD_NUMBER; + hash = (53 * hash) + getMinimumBackoff().hashCode(); + } + if (hasMaximumBackoff()) { + hash = (37 * hash) + MAXIMUM_BACKOFF_FIELD_NUMBER; + hash = (53 * hash) + getMaximumBackoff().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.pubsub.v1.RetryPolicy parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.RetryPolicy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.RetryPolicy parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.RetryPolicy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.RetryPolicy parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.pubsub.v1.RetryPolicy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.pubsub.v1.RetryPolicy parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.RetryPolicy parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.RetryPolicy parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.RetryPolicy parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.pubsub.v1.RetryPolicy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.pubsub.v1.RetryPolicy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.pubsub.v1.RetryPolicy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A policy that specifies how Cloud Pub/Sub retries message delivery.
+   * Retry delay will be exponential based on provided minimum and maximum
+   * backoffs. https://en.wikipedia.org/wiki/Exponential_backoff.
+   * RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded
+   * events for a given message.
+   * Retry Policy is implemented on a best effort basis. At times, the delay
+   * between consecutive deliveries may not match the configuration. That is,
+   * delay can be more or less than configured backoff.
+   * 
+ * + * Protobuf type {@code google.pubsub.v1.RetryPolicy} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.pubsub.v1.RetryPolicy) + com.google.pubsub.v1.RetryPolicyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.pubsub.v1.PubsubProto + .internal_static_google_pubsub_v1_RetryPolicy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.pubsub.v1.PubsubProto + .internal_static_google_pubsub_v1_RetryPolicy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.pubsub.v1.RetryPolicy.class, + com.google.pubsub.v1.RetryPolicy.Builder.class); + } + + // Construct using com.google.pubsub.v1.RetryPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (minimumBackoffBuilder_ == null) { + minimumBackoff_ = null; + } else { + minimumBackoff_ = null; + minimumBackoffBuilder_ = null; + } + if (maximumBackoffBuilder_ == null) { + maximumBackoff_ = null; + } else { + maximumBackoff_ = null; + maximumBackoffBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.pubsub.v1.PubsubProto + .internal_static_google_pubsub_v1_RetryPolicy_descriptor; + } + + @java.lang.Override + public com.google.pubsub.v1.RetryPolicy getDefaultInstanceForType() { + return com.google.pubsub.v1.RetryPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.pubsub.v1.RetryPolicy build() { + com.google.pubsub.v1.RetryPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.pubsub.v1.RetryPolicy buildPartial() { + com.google.pubsub.v1.RetryPolicy result = new com.google.pubsub.v1.RetryPolicy(this); + if (minimumBackoffBuilder_ == null) { + result.minimumBackoff_ = minimumBackoff_; + } else { + result.minimumBackoff_ = minimumBackoffBuilder_.build(); + } + if (maximumBackoffBuilder_ == null) { + result.maximumBackoff_ = maximumBackoff_; + } else { + result.maximumBackoff_ = maximumBackoffBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.pubsub.v1.RetryPolicy) { + return mergeFrom((com.google.pubsub.v1.RetryPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.pubsub.v1.RetryPolicy other) { + if (other == com.google.pubsub.v1.RetryPolicy.getDefaultInstance()) return this; + if (other.hasMinimumBackoff()) { + mergeMinimumBackoff(other.getMinimumBackoff()); + } + if (other.hasMaximumBackoff()) { + mergeMaximumBackoff(other.getMaximumBackoff()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.pubsub.v1.RetryPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.pubsub.v1.RetryPolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Duration minimumBackoff_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + minimumBackoffBuilder_; + /** + * + * + *
+     * The minimum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+     * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + * + * @return Whether the minimumBackoff field is set. + */ + public boolean hasMinimumBackoff() { + return minimumBackoffBuilder_ != null || minimumBackoff_ != null; + } + /** + * + * + *
+     * The minimum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+     * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + * + * @return The minimumBackoff. + */ + public com.google.protobuf.Duration getMinimumBackoff() { + if (minimumBackoffBuilder_ == null) { + return minimumBackoff_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minimumBackoff_; + } else { + return minimumBackoffBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The minimum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+     * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + */ + public Builder setMinimumBackoff(com.google.protobuf.Duration value) { + if (minimumBackoffBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minimumBackoff_ = value; + onChanged(); + } else { + minimumBackoffBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The minimum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+     * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + */ + public Builder setMinimumBackoff(com.google.protobuf.Duration.Builder builderForValue) { + if (minimumBackoffBuilder_ == null) { + minimumBackoff_ = builderForValue.build(); + onChanged(); + } else { + minimumBackoffBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The minimum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+     * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + */ + public Builder mergeMinimumBackoff(com.google.protobuf.Duration value) { + if (minimumBackoffBuilder_ == null) { + if (minimumBackoff_ != null) { + minimumBackoff_ = + com.google.protobuf.Duration.newBuilder(minimumBackoff_) + .mergeFrom(value) + .buildPartial(); + } else { + minimumBackoff_ = value; + } + onChanged(); + } else { + minimumBackoffBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The minimum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+     * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + */ + public Builder clearMinimumBackoff() { + if (minimumBackoffBuilder_ == null) { + minimumBackoff_ = null; + onChanged(); + } else { + minimumBackoff_ = null; + minimumBackoffBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The minimum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+     * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + */ + public com.google.protobuf.Duration.Builder getMinimumBackoffBuilder() { + + onChanged(); + return getMinimumBackoffFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The minimum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+     * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + */ + public com.google.protobuf.DurationOrBuilder getMinimumBackoffOrBuilder() { + if (minimumBackoffBuilder_ != null) { + return minimumBackoffBuilder_.getMessageOrBuilder(); + } else { + return minimumBackoff_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : minimumBackoff_; + } + } + /** + * + * + *
+     * The minimum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+     * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getMinimumBackoffFieldBuilder() { + if (minimumBackoffBuilder_ == null) { + minimumBackoffBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getMinimumBackoff(), getParentForChildren(), isClean()); + minimumBackoff_ = null; + } + return minimumBackoffBuilder_; + } + + private com.google.protobuf.Duration maximumBackoff_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + maximumBackoffBuilder_; + /** + * + * + *
+     * The maximum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+     * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + * + * @return Whether the maximumBackoff field is set. + */ + public boolean hasMaximumBackoff() { + return maximumBackoffBuilder_ != null || maximumBackoff_ != null; + } + /** + * + * + *
+     * The maximum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+     * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + * + * @return The maximumBackoff. + */ + public com.google.protobuf.Duration getMaximumBackoff() { + if (maximumBackoffBuilder_ == null) { + return maximumBackoff_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : maximumBackoff_; + } else { + return maximumBackoffBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The maximum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+     * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + */ + public Builder setMaximumBackoff(com.google.protobuf.Duration value) { + if (maximumBackoffBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maximumBackoff_ = value; + onChanged(); + } else { + maximumBackoffBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The maximum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+     * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + */ + public Builder setMaximumBackoff(com.google.protobuf.Duration.Builder builderForValue) { + if (maximumBackoffBuilder_ == null) { + maximumBackoff_ = builderForValue.build(); + onChanged(); + } else { + maximumBackoffBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The maximum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+     * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + */ + public Builder mergeMaximumBackoff(com.google.protobuf.Duration value) { + if (maximumBackoffBuilder_ == null) { + if (maximumBackoff_ != null) { + maximumBackoff_ = + com.google.protobuf.Duration.newBuilder(maximumBackoff_) + .mergeFrom(value) + .buildPartial(); + } else { + maximumBackoff_ = value; + } + onChanged(); + } else { + maximumBackoffBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The maximum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+     * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + */ + public Builder clearMaximumBackoff() { + if (maximumBackoffBuilder_ == null) { + maximumBackoff_ = null; + onChanged(); + } else { + maximumBackoff_ = null; + maximumBackoffBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The maximum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+     * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + */ + public com.google.protobuf.Duration.Builder getMaximumBackoffBuilder() { + + onChanged(); + return getMaximumBackoffFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The maximum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+     * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + */ + public com.google.protobuf.DurationOrBuilder getMaximumBackoffOrBuilder() { + if (maximumBackoffBuilder_ != null) { + return maximumBackoffBuilder_.getMessageOrBuilder(); + } else { + return maximumBackoff_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : maximumBackoff_; + } + } + /** + * + * + *
+     * The maximum delay between consecutive deliveries of a given message.
+     * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+     * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getMaximumBackoffFieldBuilder() { + if (maximumBackoffBuilder_ == null) { + maximumBackoffBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getMaximumBackoff(), getParentForChildren(), isClean()); + maximumBackoff_ = null; + } + return maximumBackoffBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.pubsub.v1.RetryPolicy) + } + + // @@protoc_insertion_point(class_scope:google.pubsub.v1.RetryPolicy) + private static final com.google.pubsub.v1.RetryPolicy DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.pubsub.v1.RetryPolicy(); + } + + public static com.google.pubsub.v1.RetryPolicy getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RetryPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RetryPolicy(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.pubsub.v1.RetryPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicyOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicyOrBuilder.java new file mode 100644 index 000000000..e3ace44c0 --- /dev/null +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/RetryPolicyOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/pubsub/v1/pubsub.proto + +package com.google.pubsub.v1; + +public interface RetryPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.pubsub.v1.RetryPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The minimum delay between consecutive deliveries of a given message.
+   * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+   * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + * + * @return Whether the minimumBackoff field is set. + */ + boolean hasMinimumBackoff(); + /** + * + * + *
+   * The minimum delay between consecutive deliveries of a given message.
+   * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+   * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + * + * @return The minimumBackoff. + */ + com.google.protobuf.Duration getMinimumBackoff(); + /** + * + * + *
+   * The minimum delay between consecutive deliveries of a given message.
+   * Value should be between 0 and 600 seconds. Defaults to 10 seconds.
+   * 
+ * + * .google.protobuf.Duration minimum_backoff = 1; + */ + com.google.protobuf.DurationOrBuilder getMinimumBackoffOrBuilder(); + + /** + * + * + *
+   * The maximum delay between consecutive deliveries of a given message.
+   * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+   * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + * + * @return Whether the maximumBackoff field is set. + */ + boolean hasMaximumBackoff(); + /** + * + * + *
+   * The maximum delay between consecutive deliveries of a given message.
+   * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+   * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + * + * @return The maximumBackoff. + */ + com.google.protobuf.Duration getMaximumBackoff(); + /** + * + * + *
+   * The maximum delay between consecutive deliveries of a given message.
+   * Value should be between 0 and 600 seconds. Defaults to 600 seconds.
+   * 
+ * + * .google.protobuf.Duration maximum_backoff = 2; + */ + com.google.protobuf.DurationOrBuilder getMaximumBackoffOrBuilder(); +} 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 760cf6234..c91b6d10f 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 @@ -40,6 +40,7 @@ private Subscription(com.google.protobuf.GeneratedMessageV3.Builder builder) private Subscription() { name_ = ""; topic_ = ""; + filter_ = ""; } @java.lang.Override @@ -158,6 +159,13 @@ private Subscription( expirationPolicy_ = subBuilder.buildPartial(); } + break; + } + case 98: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; break; } case 106: @@ -174,6 +182,21 @@ private Subscription( deadLetterPolicy_ = subBuilder.buildPartial(); } + break; + } + case 114: + { + com.google.pubsub.v1.RetryPolicy.Builder subBuilder = null; + if (retryPolicy_ != null) { + subBuilder = retryPolicy_.toBuilder(); + } + retryPolicy_ = + input.readMessage(com.google.pubsub.v1.RetryPolicy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(retryPolicy_); + retryPolicy_ = subBuilder.buildPartial(); + } + break; } default: @@ -678,6 +701,65 @@ public com.google.pubsub.v1.ExpirationPolicyOrBuilder getExpirationPolicyOrBuild return getExpirationPolicy(); } + public static final int FILTER_FIELD_NUMBER = 12; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * An expression written in the Cloud Pub/Sub filter language. If non-empty,
+   * then only `PubsubMessage`s whose `attributes` field matches the filter are
+   * delivered on this subscription. If empty, then no messages are filtered
+   * out.
+   * <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
+   * API might be changed in backward-incompatible ways and is not recommended
+   * for production use. It is not subject to any SLA or deprecation policy.
+   * 
+ * + * string filter = 12; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * An expression written in the Cloud Pub/Sub filter language. If non-empty,
+   * then only `PubsubMessage`s whose `attributes` field matches the filter are
+   * delivered on this subscription. If empty, then no messages are filtered
+   * out.
+   * <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
+   * API might be changed in backward-incompatible ways and is not recommended
+   * for production use. It is not subject to any SLA or deprecation policy.
+   * 
+ * + * string filter = 12; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int DEAD_LETTER_POLICY_FIELD_NUMBER = 13; private com.google.pubsub.v1.DeadLetterPolicy deadLetterPolicy_; /** @@ -750,6 +832,75 @@ public com.google.pubsub.v1.DeadLetterPolicyOrBuilder getDeadLetterPolicyOrBuild return getDeadLetterPolicy(); } + public static final int RETRY_POLICY_FIELD_NUMBER = 14; + private com.google.pubsub.v1.RetryPolicy retryPolicy_; + /** + * + * + *
+   * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+   * subscription.
+   * If not set, the default retry policy is applied. This generally implies
+   * that messages will be retried as soon as possible for healthy subscribers.
+   * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+   * exceeded events for a given message.
+   * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+   * ways and is not recommended for production use. It is not subject to any
+   * SLA or deprecation policy.
+   * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + * + * @return Whether the retryPolicy field is set. + */ + public boolean hasRetryPolicy() { + return retryPolicy_ != null; + } + /** + * + * + *
+   * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+   * subscription.
+   * If not set, the default retry policy is applied. This generally implies
+   * that messages will be retried as soon as possible for healthy subscribers.
+   * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+   * exceeded events for a given message.
+   * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+   * ways and is not recommended for production use. It is not subject to any
+   * SLA or deprecation policy.
+   * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + * + * @return The retryPolicy. + */ + public com.google.pubsub.v1.RetryPolicy getRetryPolicy() { + return retryPolicy_ == null + ? com.google.pubsub.v1.RetryPolicy.getDefaultInstance() + : retryPolicy_; + } + /** + * + * + *
+   * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+   * subscription.
+   * If not set, the default retry policy is applied. This generally implies
+   * that messages will be retried as soon as possible for healthy subscribers.
+   * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+   * exceeded events for a given message.
+   * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+   * ways and is not recommended for production use. It is not subject to any
+   * SLA or deprecation policy.
+   * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + */ + public com.google.pubsub.v1.RetryPolicyOrBuilder getRetryPolicyOrBuilder() { + return getRetryPolicy(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -790,9 +941,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (expirationPolicy_ != null) { output.writeMessage(11, getExpirationPolicy()); } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, filter_); + } if (deadLetterPolicy_ != null) { output.writeMessage(13, getDeadLetterPolicy()); } + if (retryPolicy_ != null) { + output.writeMessage(14, getRetryPolicy()); + } unknownFields.writeTo(output); } @@ -838,9 +995,15 @@ public int getSerializedSize() { if (expirationPolicy_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getExpirationPolicy()); } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, filter_); + } if (deadLetterPolicy_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getDeadLetterPolicy()); } + if (retryPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getRetryPolicy()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -874,10 +1037,15 @@ public boolean equals(final java.lang.Object obj) { if (hasExpirationPolicy()) { if (!getExpirationPolicy().equals(other.getExpirationPolicy())) return false; } + if (!getFilter().equals(other.getFilter())) return false; if (hasDeadLetterPolicy() != other.hasDeadLetterPolicy()) return false; if (hasDeadLetterPolicy()) { if (!getDeadLetterPolicy().equals(other.getDeadLetterPolicy())) return false; } + if (hasRetryPolicy() != other.hasRetryPolicy()) return false; + if (hasRetryPolicy()) { + if (!getRetryPolicy().equals(other.getRetryPolicy())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -915,10 +1083,16 @@ public int hashCode() { hash = (37 * hash) + EXPIRATION_POLICY_FIELD_NUMBER; hash = (53 * hash) + getExpirationPolicy().hashCode(); } + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); if (hasDeadLetterPolicy()) { hash = (37 * hash) + DEAD_LETTER_POLICY_FIELD_NUMBER; hash = (53 * hash) + getDeadLetterPolicy().hashCode(); } + if (hasRetryPolicy()) { + hash = (37 * hash) + RETRY_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getRetryPolicy().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -1112,12 +1286,20 @@ public Builder clear() { expirationPolicy_ = null; expirationPolicyBuilder_ = null; } + filter_ = ""; + if (deadLetterPolicyBuilder_ == null) { deadLetterPolicy_ = null; } else { deadLetterPolicy_ = null; deadLetterPolicyBuilder_ = null; } + if (retryPolicyBuilder_ == null) { + retryPolicy_ = null; + } else { + retryPolicy_ = null; + retryPolicyBuilder_ = null; + } return this; } @@ -1167,11 +1349,17 @@ public com.google.pubsub.v1.Subscription buildPartial() { } else { result.expirationPolicy_ = expirationPolicyBuilder_.build(); } + result.filter_ = filter_; if (deadLetterPolicyBuilder_ == null) { result.deadLetterPolicy_ = deadLetterPolicy_; } else { result.deadLetterPolicy_ = deadLetterPolicyBuilder_.build(); } + if (retryPolicyBuilder_ == null) { + result.retryPolicy_ = retryPolicy_; + } else { + result.retryPolicy_ = retryPolicyBuilder_.build(); + } onBuilt(); return result; } @@ -1248,9 +1436,16 @@ public Builder mergeFrom(com.google.pubsub.v1.Subscription other) { if (other.hasExpirationPolicy()) { mergeExpirationPolicy(other.getExpirationPolicy()); } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } if (other.hasDeadLetterPolicy()) { mergeDeadLetterPolicy(other.getDeadLetterPolicy()); } + if (other.hasRetryPolicy()) { + mergeRetryPolicy(other.getRetryPolicy()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -2600,6 +2795,142 @@ public com.google.pubsub.v1.ExpirationPolicyOrBuilder getExpirationPolicyOrBuild return expirationPolicyBuilder_; } + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * An expression written in the Cloud Pub/Sub filter language. If non-empty,
+     * then only `PubsubMessage`s whose `attributes` field matches the filter are
+     * delivered on this subscription. If empty, then no messages are filtered
+     * out.
+     * <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
+     * API might be changed in backward-incompatible ways and is not recommended
+     * for production use. It is not subject to any SLA or deprecation policy.
+     * 
+ * + * string filter = 12; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * An expression written in the Cloud Pub/Sub filter language. If non-empty,
+     * then only `PubsubMessage`s whose `attributes` field matches the filter are
+     * delivered on this subscription. If empty, then no messages are filtered
+     * out.
+     * <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
+     * API might be changed in backward-incompatible ways and is not recommended
+     * for production use. It is not subject to any SLA or deprecation policy.
+     * 
+ * + * string filter = 12; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * An expression written in the Cloud Pub/Sub filter language. If non-empty,
+     * then only `PubsubMessage`s whose `attributes` field matches the filter are
+     * delivered on this subscription. If empty, then no messages are filtered
+     * out.
+     * <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
+     * API might be changed in backward-incompatible ways and is not recommended
+     * for production use. It is not subject to any SLA or deprecation policy.
+     * 
+ * + * string filter = 12; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An expression written in the Cloud Pub/Sub filter language. If non-empty,
+     * then only `PubsubMessage`s whose `attributes` field matches the filter are
+     * delivered on this subscription. If empty, then no messages are filtered
+     * out.
+     * <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
+     * API might be changed in backward-incompatible ways and is not recommended
+     * for production use. It is not subject to any SLA or deprecation policy.
+     * 
+ * + * string filter = 12; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * An expression written in the Cloud Pub/Sub filter language. If non-empty,
+     * then only `PubsubMessage`s whose `attributes` field matches the filter are
+     * delivered on this subscription. If empty, then no messages are filtered
+     * out.
+     * <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
+     * API might be changed in backward-incompatible ways and is not recommended
+     * for production use. It is not subject to any SLA or deprecation policy.
+     * 
+ * + * string filter = 12; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + private com.google.pubsub.v1.DeadLetterPolicy deadLetterPolicy_; private com.google.protobuf.SingleFieldBuilderV3< com.google.pubsub.v1.DeadLetterPolicy, @@ -2867,6 +3198,263 @@ public com.google.pubsub.v1.DeadLetterPolicyOrBuilder getDeadLetterPolicyOrBuild return deadLetterPolicyBuilder_; } + private com.google.pubsub.v1.RetryPolicy retryPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.RetryPolicy, + com.google.pubsub.v1.RetryPolicy.Builder, + com.google.pubsub.v1.RetryPolicyOrBuilder> + retryPolicyBuilder_; + /** + * + * + *
+     * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+     * subscription.
+     * If not set, the default retry policy is applied. This generally implies
+     * that messages will be retried as soon as possible for healthy subscribers.
+     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+     * exceeded events for a given message.
+     * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+     * ways and is not recommended for production use. It is not subject to any
+     * SLA or deprecation policy.
+     * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + * + * @return Whether the retryPolicy field is set. + */ + public boolean hasRetryPolicy() { + return retryPolicyBuilder_ != null || retryPolicy_ != null; + } + /** + * + * + *
+     * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+     * subscription.
+     * If not set, the default retry policy is applied. This generally implies
+     * that messages will be retried as soon as possible for healthy subscribers.
+     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+     * exceeded events for a given message.
+     * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+     * ways and is not recommended for production use. It is not subject to any
+     * SLA or deprecation policy.
+     * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + * + * @return The retryPolicy. + */ + public com.google.pubsub.v1.RetryPolicy getRetryPolicy() { + if (retryPolicyBuilder_ == null) { + return retryPolicy_ == null + ? com.google.pubsub.v1.RetryPolicy.getDefaultInstance() + : retryPolicy_; + } else { + return retryPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+     * subscription.
+     * If not set, the default retry policy is applied. This generally implies
+     * that messages will be retried as soon as possible for healthy subscribers.
+     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+     * exceeded events for a given message.
+     * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+     * ways and is not recommended for production use. It is not subject to any
+     * SLA or deprecation policy.
+     * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + */ + public Builder setRetryPolicy(com.google.pubsub.v1.RetryPolicy value) { + if (retryPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retryPolicy_ = value; + onChanged(); + } else { + retryPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+     * subscription.
+     * If not set, the default retry policy is applied. This generally implies
+     * that messages will be retried as soon as possible for healthy subscribers.
+     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+     * exceeded events for a given message.
+     * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+     * ways and is not recommended for production use. It is not subject to any
+     * SLA or deprecation policy.
+     * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + */ + public Builder setRetryPolicy(com.google.pubsub.v1.RetryPolicy.Builder builderForValue) { + if (retryPolicyBuilder_ == null) { + retryPolicy_ = builderForValue.build(); + onChanged(); + } else { + retryPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+     * subscription.
+     * If not set, the default retry policy is applied. This generally implies
+     * that messages will be retried as soon as possible for healthy subscribers.
+     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+     * exceeded events for a given message.
+     * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+     * ways and is not recommended for production use. It is not subject to any
+     * SLA or deprecation policy.
+     * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + */ + public Builder mergeRetryPolicy(com.google.pubsub.v1.RetryPolicy value) { + if (retryPolicyBuilder_ == null) { + if (retryPolicy_ != null) { + retryPolicy_ = + com.google.pubsub.v1.RetryPolicy.newBuilder(retryPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + retryPolicy_ = value; + } + onChanged(); + } else { + retryPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+     * subscription.
+     * If not set, the default retry policy is applied. This generally implies
+     * that messages will be retried as soon as possible for healthy subscribers.
+     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+     * exceeded events for a given message.
+     * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+     * ways and is not recommended for production use. It is not subject to any
+     * SLA or deprecation policy.
+     * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + */ + public Builder clearRetryPolicy() { + if (retryPolicyBuilder_ == null) { + retryPolicy_ = null; + onChanged(); + } else { + retryPolicy_ = null; + retryPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+     * subscription.
+     * If not set, the default retry policy is applied. This generally implies
+     * that messages will be retried as soon as possible for healthy subscribers.
+     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+     * exceeded events for a given message.
+     * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+     * ways and is not recommended for production use. It is not subject to any
+     * SLA or deprecation policy.
+     * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + */ + public com.google.pubsub.v1.RetryPolicy.Builder getRetryPolicyBuilder() { + + onChanged(); + return getRetryPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+     * subscription.
+     * If not set, the default retry policy is applied. This generally implies
+     * that messages will be retried as soon as possible for healthy subscribers.
+     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+     * exceeded events for a given message.
+     * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+     * ways and is not recommended for production use. It is not subject to any
+     * SLA or deprecation policy.
+     * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + */ + public com.google.pubsub.v1.RetryPolicyOrBuilder getRetryPolicyOrBuilder() { + if (retryPolicyBuilder_ != null) { + return retryPolicyBuilder_.getMessageOrBuilder(); + } else { + return retryPolicy_ == null + ? com.google.pubsub.v1.RetryPolicy.getDefaultInstance() + : retryPolicy_; + } + } + /** + * + * + *
+     * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+     * subscription.
+     * If not set, the default retry policy is applied. This generally implies
+     * that messages will be retried as soon as possible for healthy subscribers.
+     * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+     * exceeded events for a given message.
+     * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+     * ways and is not recommended for production use. It is not subject to any
+     * SLA or deprecation policy.
+     * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.RetryPolicy, + com.google.pubsub.v1.RetryPolicy.Builder, + com.google.pubsub.v1.RetryPolicyOrBuilder> + getRetryPolicyFieldBuilder() { + if (retryPolicyBuilder_ == null) { + retryPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.pubsub.v1.RetryPolicy, + com.google.pubsub.v1.RetryPolicy.Builder, + com.google.pubsub.v1.RetryPolicyOrBuilder>( + getRetryPolicy(), getParentForChildren(), isClean()); + retryPolicy_ = null; + } + return retryPolicyBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriptionOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriptionOrBuilder.java index acc4e7572..0c1a6fe40 100644 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriptionOrBuilder.java +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriptionOrBuilder.java @@ -358,6 +358,43 @@ public interface SubscriptionOrBuilder */ com.google.pubsub.v1.ExpirationPolicyOrBuilder getExpirationPolicyOrBuilder(); + /** + * + * + *
+   * An expression written in the Cloud Pub/Sub filter language. If non-empty,
+   * then only `PubsubMessage`s whose `attributes` field matches the filter are
+   * delivered on this subscription. If empty, then no messages are filtered
+   * out.
+   * <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
+   * API might be changed in backward-incompatible ways and is not recommended
+   * for production use. It is not subject to any SLA or deprecation policy.
+   * 
+ * + * string filter = 12; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * An expression written in the Cloud Pub/Sub filter language. If non-empty,
+   * then only `PubsubMessage`s whose `attributes` field matches the filter are
+   * delivered on this subscription. If empty, then no messages are filtered
+   * out.
+   * <b>EXPERIMENTAL:</b> This feature is part of a closed alpha release. This
+   * API might be changed in backward-incompatible ways and is not recommended
+   * for production use. It is not subject to any SLA or deprecation policy.
+   * 
+ * + * string filter = 12; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + /** * * @@ -419,4 +456,63 @@ public interface SubscriptionOrBuilder * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; */ com.google.pubsub.v1.DeadLetterPolicyOrBuilder getDeadLetterPolicyOrBuilder(); + + /** + * + * + *
+   * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+   * subscription.
+   * If not set, the default retry policy is applied. This generally implies
+   * that messages will be retried as soon as possible for healthy subscribers.
+   * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+   * exceeded events for a given message.
+   * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+   * ways and is not recommended for production use. It is not subject to any
+   * SLA or deprecation policy.
+   * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + * + * @return Whether the retryPolicy field is set. + */ + boolean hasRetryPolicy(); + /** + * + * + *
+   * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+   * subscription.
+   * If not set, the default retry policy is applied. This generally implies
+   * that messages will be retried as soon as possible for healthy subscribers.
+   * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+   * exceeded events for a given message.
+   * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+   * ways and is not recommended for production use. It is not subject to any
+   * SLA or deprecation policy.
+   * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + * + * @return The retryPolicy. + */ + com.google.pubsub.v1.RetryPolicy getRetryPolicy(); + /** + * + * + *
+   * A policy that specifies how Cloud Pub/Sub retries message delivery for this
+   * subscription.
+   * If not set, the default retry policy is applied. This generally implies
+   * that messages will be retried as soon as possible for healthy subscribers.
+   * RetryPolicy will be triggered on NACKs or acknowledgement deadline
+   * exceeded events for a given message.
+   * <b>EXPERIMENTAL:</b> This API might be changed in backward-incompatible
+   * ways and is not recommended for production use. It is not subject to any
+   * SLA or deprecation policy.
+   * 
+ * + * .google.pubsub.v1.RetryPolicy retry_policy = 14; + */ + com.google.pubsub.v1.RetryPolicyOrBuilder getRetryPolicyOrBuilder(); } diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicName.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicName.java index ea20fdd47..09996bf5e 100644 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicName.java +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/TopicName.java @@ -16,10 +16,226 @@ package com.google.pubsub.v1; +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; /** AUTO-GENERATED DOCUMENTATION AND CLASS */ @javax.annotation.Generated("by GAPIC protoc plugin") -public abstract class TopicName implements ResourceName { +public class TopicName implements ResourceName { + + @Deprecated protected TopicName() {} + + private static final PathTemplate PROJECT_TOPIC_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/topics/{topic}"); + private static final String DELETED_TOPIC_FIXED_VALUE = "_deleted-topic_"; + private static final TopicName DELETED_TOPIC_INSTANCE = new TopicName("_deleted-topic_"); + + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + + private String project; + private String topic; + + public String getProject() { + return project; + } + + public String getTopic() { + return topic; + } + + private TopicName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + topic = Preconditions.checkNotNull(builder.getTopic()); + pathTemplate = PROJECT_TOPIC_PATH_TEMPLATE; + } + + private TopicName(String fixedValue) { + this.fixedValue = fixedValue; + fieldValuesMap = ImmutableMap.of("", fixedValue); + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectTopicBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static TopicName of(String project, String topic) { + return newProjectTopicBuilder().setProject(project).setTopic(topic).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static TopicName ofProjectTopicName(String project, String topic) { + return newProjectTopicBuilder().setProject(project).setTopic(topic).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static TopicName ofDeletedTopicName() { + return DELETED_TOPIC_INSTANCE; + } + + public static String format(String project, String topic) { + return newBuilder().setProject(project).setTopic(topic).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectTopicName(String project, String topic) { + return newBuilder().setProject(project).setTopic(topic).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatDeletedTopicName() { + return DELETED_TOPIC_FIXED_VALUE; + } + + public static TopicName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_TOPIC_PATH_TEMPLATE.matches(formattedString)) { + Map matchMap = PROJECT_TOPIC_PATH_TEMPLATE.match(formattedString); + return ofProjectTopicName(matchMap.get("project"), matchMap.get("topic")); + } else if (DELETED_TOPIC_FIXED_VALUE.equals(formattedString)) { + return DELETED_TOPIC_INSTANCE; + } + throw new ValidationException("JobName.parse: formattedString not in valid format"); + } + + @BetaApi("The method will be renamed to parseList after subclasses of this class are removed.") + public static List parse(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + @BetaApi("The method will be renamed to toStringList after subclasses of this class are removed.") + public static List toStrings(List values) { + List list = new ArrayList<>(values.size()); + for (TopicName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_TOPIC_PATH_TEMPLATE.matches(formattedString) + || DELETED_TOPIC_FIXED_VALUE.equals(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (topic != null) { + fieldMapBuilder.put("topic", topic); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + /** Builder for projects/{project}/topics/{topic}. */ + public static class Builder { + + private String project; + private String topic; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getTopic() { + return topic; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setTopic(String topic) { + this.topic = topic; + return this; + } + + private Builder(TopicName topicName) { + Preconditions.checkArgument( + topicName.pathTemplate == PROJECT_TOPIC_PATH_TEMPLATE, + "toBuilder is only supported when TopicName has the pattern of " + + "projects/{project}/topics/{topic}."); + project = topicName.project; + topic = topicName.topic; + } + + public TopicName build() { + return new TopicName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + TopicName that = (TopicName) o; + return (Objects.equals(this.project, that.project)) + && (Objects.equals(this.topic, that.topic)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(topic); + return h; + } } diff --git a/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto b/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto index 55cfa531f..b49b30ed4 100644 --- a/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto +++ b/proto-google-cloud-pubsub-v1/src/main/proto/google/pubsub/v1/pubsub.proto @@ -672,6 +672,15 @@ message Subscription { // value for `expiration_policy.ttl` is 1 day. ExpirationPolicy expiration_policy = 11; + // An expression written in the Cloud Pub/Sub filter language. If non-empty, + // then only `PubsubMessage`s whose `attributes` field matches the filter are + // delivered on this subscription. If empty, then no messages are filtered + // out. + // EXPERIMENTAL: This feature is part of a closed alpha release. This + // API might be changed in backward-incompatible ways and is not recommended + // for production use. It is not subject to any SLA or deprecation policy. + string filter = 12; + // A policy that specifies the conditions for dead lettering messages in // this subscription. If dead_letter_policy is not set, dead lettering // is disabled. @@ -684,6 +693,39 @@ message Subscription { // API might be changed in backward-incompatible ways and is not recommended // for production use. It is not subject to any SLA or deprecation policy. DeadLetterPolicy dead_letter_policy = 13; + + // A policy that specifies how Cloud Pub/Sub retries message delivery for this + // subscription. + // + // If not set, the default retry policy is applied. This generally implies + // that messages will be retried as soon as possible for healthy subscribers. + // RetryPolicy will be triggered on NACKs or acknowledgement deadline + // exceeded events for a given message. + // EXPERIMENTAL: This API might be changed in backward-incompatible + // ways and is not recommended for production use. It is not subject to any + // SLA or deprecation policy. + RetryPolicy retry_policy = 14; +} + +// A policy that specifies how Cloud Pub/Sub retries message delivery. +// +// Retry delay will be exponential based on provided minimum and maximum +// backoffs. https://en.wikipedia.org/wiki/Exponential_backoff. +// +// RetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded +// events for a given message. +// +// Retry Policy is implemented on a best effort basis. At times, the delay +// between consecutive deliveries may not match the configuration. That is, +// delay can be more or less than configured backoff. +message RetryPolicy { + // The minimum delay between consecutive deliveries of a given message. + // Value should be between 0 and 600 seconds. Defaults to 10 seconds. + google.protobuf.Duration minimum_backoff = 1; + + // The maximum delay between consecutive deliveries of a given message. + // Value should be between 0 and 600 seconds. Defaults to 600 seconds. + google.protobuf.Duration maximum_backoff = 2; } // Dead lettering is done on a best effort basis. The same message might be diff --git a/renovate.json b/renovate.json index fc6412701..1b54f48af 100644 --- a/renovate.json +++ b/renovate.json @@ -56,7 +56,9 @@ }, { "packagePatterns": [ - "^com.google.cloud:libraries-bom" + "^com.google.cloud:google-cloud-pubsub", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" ], "semanticCommitType": "chore", "semanticCommitScope": "deps" @@ -75,4 +77,4 @@ } ], "semanticCommits": true -} +} \ No newline at end of file diff --git a/synth.metadata b/synth.metadata index a8cfb72d0..0dc6e39b4 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,27 +1,18 @@ { - "updateTime": "2020-03-09T22:03:30.134601Z", + "updateTime": "2020-03-30T19:22:36.952654Z", "sources": [ { "generator": { "name": "artman", - "version": "1.0.0", - "dockerImage": "googleapis/artman@sha256:f37f2464788cb551299209b4fcab4eb323533154488c2ef9ec0c75d7c2b4b482" + "version": "1.1.1", + "dockerImage": "googleapis/artman@sha256:5ef340c8d9334719bc5c6981d95f4a5d2737b0a6a24f2b9a0d430e96fff85c5b" } }, { "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "29a47c965aac79e3fe8e3314482ca0b5967680f0", - "internalRef": "299917154", - "log": "29a47c965aac79e3fe8e3314482ca0b5967680f0\nIncrease timeout to 1hr for method `dropRange` in bigtable/admin/v2, which is\nsynced with the timeout setting in gapic_yaml.\n\nPiperOrigin-RevId: 299917154\n\n8f631c4c70a60a9c7da3749511ee4ad432b62898\nbuild(google/maps/roads/v1op): move go to monorepo pattern\n\nPiperOrigin-RevId: 299885195\n\nd66816518844ebbf63504c9e8dfc7133921dd2cd\nbuild(google/maps/roads/v1op): Add bazel build files to generate clients.\n\nPiperOrigin-RevId: 299851148\n\naf7dff701fabe029672168649c62356cf1bb43d0\nAdd LogPlayerReports and LogImpressions to Playable Locations service\n\nPiperOrigin-RevId: 299724050\n\nb6927fca808f38df32a642c560082f5bf6538ced\nUpdate BigQuery Connection API v1beta1 proto: added credential to CloudSqlProperties.\n\nPiperOrigin-RevId: 299503150\n\n91e1fb5ef9829c0c7a64bfa5bde330e6ed594378\nchore: update protobuf (protoc) version to 3.11.2\n\nPiperOrigin-RevId: 299404145\n\n30e36b4bee6749c4799f4fc1a51cc8f058ba167d\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 299399890\n\nffbb493674099f265693872ae250711b2238090c\nfeat: cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields.\n\nPiperOrigin-RevId: 299397780\n\nbc973a15818e00c19e121959832676e9b7607456\nbazel: Fix broken common dependency\n\nPiperOrigin-RevId: 299397431\n\n71094a343e3b962e744aa49eb9338219537474e4\nchore: bigtable/admin/v2 publish retry config\n\nPiperOrigin-RevId: 299391875\n\n8f488efd7bda33885cb674ddd023b3678c40bd82\nfeat: Migrate logging to GAPIC v2; release new features.\n\nIMPORTANT: This is a breaking change for client libraries\nin all languages.\n\nCommitter: @lukesneeringer, @jskeet\nPiperOrigin-RevId: 299370279\n\n007605bf9ad3a1fd775014ebefbf7f1e6b31ee71\nUpdate API for bigqueryreservation v1beta1.\n- Adds flex capacity commitment plan to CapacityCommitment.\n- Adds methods for getting and updating BiReservations.\n- Adds methods for updating/splitting/merging CapacityCommitments.\n\nPiperOrigin-RevId: 299368059\n\nf0b581b5bdf803e45201ecdb3688b60e381628a8\nfix: recommendationengine/v1beta1 update some comments\n\nPiperOrigin-RevId: 299181282\n\n10e9a0a833dc85ff8f05b2c67ebe5ac785fe04ff\nbuild: add generated BUILD file for Routes Preferred API\n\nPiperOrigin-RevId: 299164808\n\n86738c956a8238d7c77f729be78b0ed887a6c913\npublish v1p1beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299152383\n\n73d9f2ad4591de45c2e1f352bc99d70cbd2a6d95\npublish v1: update with absolute address in comments\n\nPiperOrigin-RevId: 299147194\n\nd2158f24cb77b0b0ccfe68af784c6a628705e3c6\npublish v1beta2: update with absolute address in comments\n\nPiperOrigin-RevId: 299147086\n\n7fca61292c11b4cd5b352cee1a50bf88819dd63b\npublish v1p2beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146903\n\n583b7321624736e2c490e328f4b1957335779295\npublish v1p3beta1: update with absolute address in comments\n\nPiperOrigin-RevId: 299146674\n\n638253bf86d1ce1c314108a089b7351440c2f0bf\nfix: add java_multiple_files option for automl text_sentiment.proto\n\nPiperOrigin-RevId: 298971070\n\n373d655703bf914fb8b0b1cc4071d772bac0e0d1\nUpdate Recs AI Beta public bazel file\n\nPiperOrigin-RevId: 298961623\n\ndcc5d00fc8a8d8b56f16194d7c682027b2c66a3b\nfix: add java_multiple_files option for automl classification.proto\n\nPiperOrigin-RevId: 298953301\n\na3f791827266f3496a6a5201d58adc4bb265c2a3\nchore: automl/v1 publish annotations and retry config\n\nPiperOrigin-RevId: 298942178\n\n01c681586d8d6dbd60155289b587aee678530bd9\nMark return_immediately in PullRequest deprecated.\n\nPiperOrigin-RevId: 298893281\n\nc9f5e9c4bfed54bbd09227e990e7bded5f90f31c\nRemove out of date documentation for predicate support on the Storage API\n\nPiperOrigin-RevId: 298883309\n\nfd5b3b8238d783b04692a113ffe07c0363f5de0f\ngenerate webrisk v1 proto\n\nPiperOrigin-RevId: 298847934\n\n541b1ded4abadcc38e8178680b0677f65594ea6f\nUpdate cloud asset api v1p4beta1.\n\nPiperOrigin-RevId: 298686266\n\nc0d171acecb4f5b0bfd2c4ca34fc54716574e300\n Updated to include the Notification v1 API.\n\nPiperOrigin-RevId: 298652775\n\n2346a9186c0bff2c9cc439f2459d558068637e05\nAdd Service Directory v1beta1 protos and configs\n\nPiperOrigin-RevId: 298625638\n\na78ed801b82a5c6d9c5368e24b1412212e541bb7\nPublishing v3 protos and configs.\n\nPiperOrigin-RevId: 298607357\n\n4a180bfff8a21645b3a935c2756e8d6ab18a74e0\nautoml/v1beta1 publish proto updates\n\nPiperOrigin-RevId: 298484782\n\n6de6e938b7df1cd62396563a067334abeedb9676\nchore: use the latest gapic-generator and protoc-java-resource-name-plugin in Bazel workspace.\n\nPiperOrigin-RevId: 298474513\n\n" - } - }, - { - "template": { - "name": "java_library", - "origin": "synthtool.gcp", - "version": "2020.2.4" + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "e36822bfa0acb355502dab391b8ef9c4f30208d8" } } ], diff --git a/synth.py b/synth.py index 24cfcbf56..a213152b4 100644 --- a/synth.py +++ b/synth.py @@ -22,6 +22,401 @@ service = 'pubsub' versions = ['v1'] +GET_IAM_POLICY_TOPIC = """ + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+   *   Policy response = topicAdminClient.getIamPolicy(formattedResource);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead. + */ + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } +""" +GET_IAM_POLICY_SUBSCRIPTION = """ + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *


+   * try (SubscriptionAdminClient topicAdminClient = SubscriptionAdminClient.create()) {
+   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+   *   Policy response = topicAdminClient.getIamPolicy(formattedResource);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead. + */ + public final Policy getIamPolicy(String resource) { + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } +""" + +GET_IAM_POLICY_PREVIOUS = r'(\s+public final Policy getIamPolicy\(GetIamPolicyRequest request\) {\n\s+return .*\n\s+})' + +SET_IAM_POLICY_TOPIC = """ + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = topicAdminClient.setIamPolicy(formattedResource, policy);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead. + */ + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } +""" +SET_IAM_POLICY_SUBSCRIPTION = """ + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *

Sample code: + * + *


+   * try (SubscriptionAdminClient topicAdminClient = SubscriptionAdminClient.create()) {
+   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = topicAdminClient.setIamPolicy(formattedResource, policy);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud + * Platform services (such as Projects) might reject them. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead. + */ + public final Policy setIamPolicy(String resource, Policy policy) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } +""" +SET_IAM_POLICY_PREVIOUS = r'(\s+public final Policy setIamPolicy\(SetIamPolicyRequest request\) {\n\s+return .*\n\s+})' + +TEST_IAM_PERMISSIONS_TOPIC = """ + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(formattedResource, permissions);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead. + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } +""" +TEST_IAM_PERMISSIONS_SUBSCRIPTION = """ + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a NOT_FOUND error. + * + *

Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *

Sample code: + * + *


+   * try (SubscriptionAdminClient topicAdminClient = SubscriptionAdminClient.create()) {
+   *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(formattedResource, permissions);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead. + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } +""" +TEST_IAM_PERMISSIONS_PREVIOUS = r'(\s+public final TestIamPermissionsResponse testIamPermissions\(TestIamPermissionsRequest request\) {\n\s+return .*\n\s+})' + +CREATE_TOPIC = """ + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates the given topic with the given name. See the <a + * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name + * rules</a>. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   Topic response = topicAdminClient.createTopic(name);
+   * }
+   * 
+ * + * @param name Required. The name of the topic. It must have the format + * `"projects/{project}/topics/{topic}"`. `{topic}` 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"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #createTopic(TopicName)} instead. + */ + public final Topic createTopic(ProjectTopicName name) { + Topic request = Topic.newBuilder().setName(name == null ? null : name.toString()).build(); + return createTopic(request); + } +""" + +CREATE_TOPIC_PREVIOUS = r'(\s+public final Topic createTopic\(String name\) {\n\s+.*\n\s+return.*\n\s+})' + +DELETE_TOPIC = """ + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a + * topic is deleted, a new topic may be created with the same name; this is an entirely new topic + * with none of the old configuration or subscriptions. Existing subscriptions to this topic are + * not deleted, but their `topic` field is set to `_deleted-topic_`. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   topicAdminClient.deleteTopic(topic);
+   * }
+   * 
+ * + * @param topic Required. Name of the topic to delete. Format is + * `projects/{project}/topics/{topic}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #deleteTopic(TopicName)} instead. + */ + public final void deleteTopic(ProjectTopicName topic) { + DeleteTopicRequest request = + DeleteTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); + deleteTopic(request); + } +""" + +GET_TOPIC_PREVIOUS = r'(\s+public final Topic getTopic\(String topic\) {\n\s+.*\n\s+return.*\n\s+})' + +GET_TOPIC = """ + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the configuration of a topic. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   Topic response = topicAdminClient.getTopic(topic);
+   * }
+   * 
+ * + * @param topic Required. The name of the topic to get. Format is + * `projects/{project}/topics/{topic}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #getTopic(TopicName)} instead. + */ + public final Topic getTopic(ProjectTopicName topic) { + GetTopicRequest request = + GetTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); + return getTopic(request); + } +""" + +DELETE_TOPIC_PREVIOUS = r'(\s+public final void deleteTopic\(String topic\) {\n\s+.*\n\s+deleteTopic.*\n\s+})' + +LIST_TOPIC_SUBSCRIPTIONS = """ + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the names of the subscriptions on this topic. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   for (ProjectSubscriptionName element : topicAdminClient.listTopicSubscriptions(topic).iterateAllAsProjectSubscriptionName()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param topic Required. The name of the topic that subscriptions are attached to. Format is + * `projects/{project}/topics/{topic}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #listTopicSubscriptions(TopicName)} instead. + */ + public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(ProjectTopicName topic) { + ListTopicSubscriptionsRequest request = + ListTopicSubscriptionsRequest.newBuilder() + .setTopic(topic == null ? null : topic.toString()) + .build(); + return listTopicSubscriptions(request); + } +""" + +LIST_TOPIC_SUBSCRIPTIONS_PREVIOUS = r'(\s+public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions\(String topic\) {\n\s+.*\n\s+.*\n\s+return.*\n\s+})' + +CREATE_SUBSCRIPTION_PREVIOUS = r'(\s+public final Subscription createSubscription\(Subscription request\) {\n\s+return.*\n\s+})' + +CREATE_SUBSCRIPTION = """ + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a subscription to a given topic. See the <a + * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name + * rules</a>. 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: + * + *


+   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+   *   ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+   *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+   *   PushConfig pushConfig = PushConfig.newBuilder().build();
+   *   int ackDeadlineSeconds = 0;
+   *   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(ProjectSubscriptionName, TopicName, PushConfig, int)} instead. + */ + public final Subscription createSubscription( + ProjectSubscriptionName name, + ProjectTopicName 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); + } +""" + +PACKAGE = 'package com.google.cloud.pubsub.v1;' + +IMPORT_PROJECT_TOPIC_NAME = 'import com.google.pubsub.v1.ProjectTopicName;' + for version in versions: java.bazel_library( service=service, @@ -40,6 +435,78 @@ java.GOOD_LICENSE, ) + s.replace( + '**/TopicAdminClient.java', + GET_IAM_POLICY_PREVIOUS, + "\g<1>\n\n" + GET_IAM_POLICY_TOPIC + ) + + s.replace( + '**/TopicAdminClient.java', + SET_IAM_POLICY_PREVIOUS, + "\g<1>\n\n" + SET_IAM_POLICY_TOPIC + ) + + s.replace( + '**/TopicAdminClient.java', + TEST_IAM_PERMISSIONS_PREVIOUS, + "\g<1>\n\n" + TEST_IAM_PERMISSIONS_TOPIC + ) + + s.replace( + '**/SubscriptionAdminClient.java', + GET_IAM_POLICY_PREVIOUS, + "\g<1>\n\n" + GET_IAM_POLICY_SUBSCRIPTION + ) + + s.replace( + '**/SubscriptionAdminClient.java', + SET_IAM_POLICY_PREVIOUS, + "\g<1>\n\n" + SET_IAM_POLICY_SUBSCRIPTION + ) + + s.replace( + '**/SubscriptionAdminClient.java', + TEST_IAM_PERMISSIONS_PREVIOUS, + "\g<1>\n\n" + TEST_IAM_PERMISSIONS_SUBSCRIPTION + ) + + s.replace( + '**/TopicAdminClient.java', + CREATE_TOPIC_PREVIOUS, + "\g<1>\n\n" + CREATE_TOPIC + ) + + s.replace( + '**/TopicAdminClient.java', + DELETE_TOPIC_PREVIOUS, + "\g<1>\n\n" + DELETE_TOPIC + ) + + s.replace( + '**/TopicAdminClient.java', + LIST_TOPIC_SUBSCRIPTIONS_PREVIOUS, + "\g<1>\n\n" + LIST_TOPIC_SUBSCRIPTIONS + ) + + s.replace( + '**/TopicAdminClient.java', + GET_TOPIC_PREVIOUS, + "\g<1>\n\n" + GET_TOPIC + ) + + s.replace( + '**/SubscriptionAdminClient.java', + CREATE_SUBSCRIPTION_PREVIOUS, + "\g<1>\n\n" + CREATE_SUBSCRIPTION + ) + + s.replace( + '**/*AdminClient.java', + PACKAGE, + PACKAGE + '\n\n' + IMPORT_PROJECT_TOPIC_NAME + '\n' + ) + java.format_code('google-cloud-pubsub/src') java.format_code(f'grpc-google-cloud-{service}-{version}/src') java.format_code(f'proto-google-cloud-{service}-{version}/src')