From 91b5152ba9942e9ce4cfd2051e4b8b358b465601 Mon Sep 17 00:00:00 2001 From: hannahrogers-google <52459909+hannahrogers-google@users.noreply.github.com> Date: Thu, 21 Jan 2021 12:06:22 -0800 Subject: [PATCH] fix: adding deprecated tags to deprecated methods (#472) * Modifying Publish example in README to match other examples given, and fix issue #6784 * fix: Modifying Publish example in README to match other examples, and fix Issue #11 * feat: Adding support for DLQs Adding delivery attempt count to PubsubMessages as a message attribute, and creating helper function to allow users to get the count without knowing implementation details. * Fix formatting * fix: making changes requested in pull request * fix: creating fix to not populate delivery attempt attribute when dead lettering is not enabled * Adding unit test for case in which a received message has no delivery attempt * Making MessageWaiter class more generic to also be used for outstanding ack operations * Waiting for acks to complete before shutting down a streaming subscriber connection * Fixing formatting error * fix: making sure all publishes complete before shutting down the publisher * adding default max outstanding request bytes * fix: make push endpoint valid https * fix: use default zero value if a flow control setting is not provided * fix lint issues * fix: better cleanup during publisher test * fix: format issues * fix: test timeouts should be a minute * fix: make subscriberIt less flaky * fix: add deprecated tag for deprecated methods * fix: retrying sync pulls in subscriberIT test * Revert "fix: retrying sync pulls in subscriberIT test" This reverts commit fef99561335f6e60e70ca7d0d00ac4d74a9f431e. --- synth.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/synth.py b/synth.py index 08906abd9..dc1bcba5e 100644 --- a/synth.py +++ b/synth.py @@ -42,6 +42,7 @@ * @throws com.google.api.gax.rpc.ApiException if the remote call fails * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead. */ + @Deprecated public final Policy getIamPolicy(String resource) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); return getIamPolicy(request); @@ -56,9 +57,9 @@ *

Sample code: * *


-   * try (SubscriptionAdminClient topicAdminClient = SubscriptionAdminClient.create()) {
+   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
    *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
-   *   Policy response = topicAdminClient.getIamPolicy(formattedResource);
+   *   Policy response = subscriptionAdminClient.getIamPolicy(formattedResource);
    * }
    * 
* @@ -67,6 +68,7 @@ * @throws com.google.api.gax.rpc.ApiException if the remote call fails * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead. */ + @Deprecated public final Policy getIamPolicy(String resource) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); return getIamPolicy(request); @@ -100,6 +102,7 @@ * @throws com.google.api.gax.rpc.ApiException if the remote call fails * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead. */ + @Deprecated public final Policy setIamPolicy(String resource, Policy policy) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); @@ -116,10 +119,10 @@ *

Sample code: * *


-   * try (SubscriptionAdminClient topicAdminClient = SubscriptionAdminClient.create()) {
+   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
    *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
    *   Policy policy = Policy.newBuilder().build();
-   *   Policy response = topicAdminClient.setIamPolicy(formattedResource, policy);
+   *   Policy response = subscriptionAdminClient.setIamPolicy(formattedResource, policy);
    * }
    * 
* @@ -131,6 +134,7 @@ * @throws com.google.api.gax.rpc.ApiException if the remote call fails * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead. */ + @Deprecated public final Policy setIamPolicy(String resource, Policy policy) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); @@ -167,6 +171,7 @@ * @throws com.google.api.gax.rpc.ApiException if the remote call fails * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead. */ + @Deprecated public final TestIamPermissionsResponse testIamPermissions( String resource, List permissions) { TestIamPermissionsRequest request = @@ -190,10 +195,10 @@ *

Sample code: * *


-   * try (SubscriptionAdminClient topicAdminClient = SubscriptionAdminClient.create()) {
+   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
    *   String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
    *   List<String> permissions = new ArrayList<>();
-   *   TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(formattedResource, permissions);
+   *   TestIamPermissionsResponse response = subscriptionAdminClient.testIamPermissions(formattedResource, permissions);
    * }
    * 
* @@ -205,6 +210,7 @@ * @throws com.google.api.gax.rpc.ApiException if the remote call fails * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead. */ + @Deprecated public final TestIamPermissionsResponse testIamPermissions( String resource, List permissions) { TestIamPermissionsRequest request = @@ -241,6 +247,7 @@ * @throws com.google.api.gax.rpc.ApiException if the remote call fails * @deprecated Use {@link #createTopic(TopicName)} instead. */ + @Deprecated public final Topic createTopic(ProjectTopicName name) { Topic request = Topic.newBuilder().setName(name == null ? null : name.toString()).build(); return createTopic(request); @@ -271,6 +278,7 @@ * @throws com.google.api.gax.rpc.ApiException if the remote call fails * @deprecated Use {@link #deleteTopic(TopicName)} instead. */ + @Deprecated public final void deleteTopic(ProjectTopicName topic) { DeleteTopicRequest request = DeleteTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); @@ -299,6 +307,7 @@ * @throws com.google.api.gax.rpc.ApiException if the remote call fails * @deprecated Use {@link #getTopic(TopicName)} instead. */ + @Deprecated public final Topic getTopic(ProjectTopicName topic) { GetTopicRequest request = GetTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build(); @@ -329,6 +338,7 @@ * @throws com.google.api.gax.rpc.ApiException if the remote call fails * @deprecated Use {@link #listTopicSubscriptions(TopicName)} instead. */ + @Deprecated public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(ProjectTopicName topic) { ListTopicSubscriptionsRequest request = ListTopicSubscriptionsRequest.newBuilder() @@ -397,6 +407,7 @@ * @throws com.google.api.gax.rpc.ApiException if the remote call fails * @deprecated Use {@link #createSubscription(ProjectSubscriptionName, TopicName, PushConfig, int)} instead. */ + @Deprecated public final Subscription createSubscription( ProjectSubscriptionName name, ProjectTopicName topic,