Skip to content

Commit

Permalink
fix: adding deprecated tags to deprecated methods (#472)
Browse files Browse the repository at this point in the history
* 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 fef9956.
  • Loading branch information
hannahrogers-google committed Jan 21, 2021
1 parent 44b6780 commit 91b5152
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions synth.py
Expand Up @@ -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);
Expand All @@ -56,9 +57,9 @@
* <p>Sample code:
*
* <pre><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);
* }
* </code></pre>
*
Expand All @@ -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);
Expand Down Expand Up @@ -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();
Expand All @@ -116,10 +119,10 @@
* <p>Sample code:
*
* <pre><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);
* }
* </code></pre>
*
Expand All @@ -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();
Expand Down Expand Up @@ -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<String> permissions) {
TestIamPermissionsRequest request =
Expand All @@ -190,10 +195,10 @@
* <p>Sample code:
*
* <pre><code>
* try (SubscriptionAdminClient topicAdminClient = SubscriptionAdminClient.create()) {
* try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
* String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
* List&lt;String&gt; permissions = new ArrayList&lt;&gt;();
* TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(formattedResource, permissions);
* TestIamPermissionsResponse response = subscriptionAdminClient.testIamPermissions(formattedResource, permissions);
* }
* </code></pre>
*
Expand All @@ -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<String> permissions) {
TestIamPermissionsRequest request =
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 91b5152

Please sign in to comment.