diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 085021dde..f2dbdee06 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -99,7 +99,16 @@ mvn -Penable-samples clean verify ``` 2. [Activate](#profile-activation) the profile. -3. Define your samples in a normal Maven project in the `samples/` directory +3. Define your samples in a normal Maven project in the `samples/` directory. + +### Code Formatting + +Code in this repo is formatted with +[google-java-format](https://github.com/google/google-java-format). +To run formatting on your project, you can run: +``` +mvn com.coveo:fmt-maven-plugin:format +``` ### Profile Activation diff --git a/README.md b/README.md index a803ef5d9..be3c05769 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 5.1.0 + 5.3.0 pom import @@ -38,7 +38,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-pubsub - 1.105.0 + 1.105.1 ``` @@ -259,7 +259,7 @@ Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] [product-docs]: https://cloud.google.com/pubsub/docs/ -[javadocs]: https://googleapis.dev/java/google-cloud-pubsub/latest/index.html +[javadocs]: https://googleapis.dev/java/google-cloud-pubusb/latest/index.html [kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java7.svg [kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java7.html [kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java8.svg 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 227271f32..2fbd6ff96 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 @@ -39,6 +39,7 @@ import com.google.pubsub.v1.CreateSnapshotRequest; import com.google.pubsub.v1.DeleteSnapshotRequest; import com.google.pubsub.v1.DeleteSubscriptionRequest; +import com.google.pubsub.v1.GetSnapshotRequest; import com.google.pubsub.v1.GetSubscriptionRequest; import com.google.pubsub.v1.ListSnapshotsRequest; import com.google.pubsub.v1.ListSnapshotsResponse; @@ -861,6 +862,110 @@ public final UnaryCallable deleteSubscriptionC return stub.deleteSubscriptionCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the configuration details of a snapshot. Snapshots are used in <a + * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment + * state of messages in an existing subscription to the state captured by a snapshot. + * + *

Sample code: + * + *


+   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   Snapshot response = subscriptionAdminClient.getSnapshot(snapshot);
+   * }
+   * 
+ * + * @param snapshot Required. The name of the snapshot to get. Format is + * `projects/{project}/snapshots/{snap}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + /* package-private */ final Snapshot getSnapshot(ProjectSnapshotName snapshot) { + GetSnapshotRequest request = + GetSnapshotRequest.newBuilder() + .setSnapshot(snapshot == null ? null : snapshot.toString()) + .build(); + return getSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the configuration details of a snapshot. Snapshots are used in <a + * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment + * state of messages in an existing subscription to the state captured by a snapshot. + * + *

Sample code: + * + *


+   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   Snapshot response = subscriptionAdminClient.getSnapshot(snapshot.toString());
+   * }
+   * 
+ * + * @param snapshot Required. The name of the snapshot to get. Format is + * `projects/{project}/snapshots/{snap}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + /* package-private */ final Snapshot getSnapshot(String snapshot) { + GetSnapshotRequest request = GetSnapshotRequest.newBuilder().setSnapshot(snapshot).build(); + return getSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the configuration details of a snapshot. Snapshots are used in <a + * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment + * state of messages in an existing subscription to the state captured by a snapshot. + * + *

Sample code: + * + *


+   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   GetSnapshotRequest request = GetSnapshotRequest.newBuilder()
+   *     .setSnapshot(snapshot.toString())
+   *     .build();
+   *   Snapshot response = subscriptionAdminClient.getSnapshot(request);
+   * }
+   * 
+ * + * @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 + */ + /* package-private */ final Snapshot getSnapshot(GetSnapshotRequest request) { + return getSnapshotCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the configuration details of a snapshot. Snapshots are used in <a + * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment + * state of messages in an existing subscription to the state captured by a snapshot. + * + *

Sample code: + * + *


+   * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+   *   ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]");
+   *   GetSnapshotRequest request = GetSnapshotRequest.newBuilder()
+   *     .setSnapshot(snapshot.toString())
+   *     .build();
+   *   ApiFuture<Snapshot> future = subscriptionAdminClient.getSnapshotCallable().futureCall(request);
+   *   // Do something
+   *   Snapshot response = future.get();
+   * }
+   * 
+ */ + /* package-private */ final UnaryCallable getSnapshotCallable() { + return stub.getSnapshotCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Modifies the ack deadline for a specific message. This method is useful to indicate that more @@ -1989,7 +2094,7 @@ public final UnaryCallable seekCallable() { /** * Sets the access control policy on the specified resource. Replaces any existing policy. * - *

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

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. * *

Sample code: * @@ -2046,7 +2151,7 @@ public final Policy setIamPolicy(String resource, Policy policy) { /** * Sets the access control policy on the specified resource. Replaces any existing policy. * - *

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

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. * *

Sample code: * @@ -2142,7 +2247,7 @@ public final UnaryCallable getIamPolicyCallable() { // 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. + * 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 @@ -2209,7 +2314,7 @@ public final TestIamPermissionsResponse testIamPermissions( // 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. + * 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 diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java index 32e5a6c5c..06d12d8ff 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java @@ -41,6 +41,7 @@ import com.google.pubsub.v1.CreateSnapshotRequest; import com.google.pubsub.v1.DeleteSnapshotRequest; import com.google.pubsub.v1.DeleteSubscriptionRequest; +import com.google.pubsub.v1.GetSnapshotRequest; import com.google.pubsub.v1.GetSubscriptionRequest; import com.google.pubsub.v1.ListSnapshotsRequest; import com.google.pubsub.v1.ListSnapshotsResponse; @@ -122,6 +123,11 @@ public UnaryCallSettings deleteSubscriptionSet return ((SubscriberStubSettings) getStubSettings()).deleteSubscriptionSettings(); } + /** Returns the object with the settings used for calls to getSnapshot. */ + /* package-private */ UnaryCallSettings getSnapshotSettings() { + return ((SubscriberStubSettings) getStubSettings()).getSnapshotSettings(); + } + /** Returns the object with the settings used for calls to modifyAckDeadline. */ /* package-private */ UnaryCallSettings modifyAckDeadlineSettings() { @@ -318,6 +324,12 @@ public UnaryCallSettings.Builder createSubscriptionS return getStubSettingsBuilder().deleteSubscriptionSettings(); } + /** Returns the builder for the settings used for calls to getSnapshot. */ + /* package-private */ UnaryCallSettings.Builder + getSnapshotSettings() { + return getStubSettingsBuilder().getSnapshotSettings(); + } + /** Returns the builder for the settings used for calls to modifyAckDeadline. */ /* package-private */ UnaryCallSettings.Builder modifyAckDeadlineSettings() { 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 11951c869..548523021 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 @@ -38,6 +38,8 @@ import com.google.protobuf.Empty; import com.google.pubsub.v1.DeleteTopicRequest; import com.google.pubsub.v1.GetTopicRequest; +import com.google.pubsub.v1.ListTopicSnapshotsRequest; +import com.google.pubsub.v1.ListTopicSnapshotsResponse; import com.google.pubsub.v1.ListTopicSubscriptionsRequest; import com.google.pubsub.v1.ListTopicSubscriptionsResponse; import com.google.pubsub.v1.ListTopicsRequest; @@ -883,6 +885,157 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions( return stub.listTopicSubscriptionsCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the names of the snapshots on this topic. Snapshots are used in <a + * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment + * state of messages in an existing subscription to the state captured by a snapshot. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
+   *   for (String element : topicAdminClient.listTopicSnapshots(topic).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param topic Required. The name of the topic that snapshots are attached to. Format is + * `projects/{project}/topics/{topic}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + /* package-private */ final ListTopicSnapshotsPagedResponse listTopicSnapshots(TopicName topic) { + ListTopicSnapshotsRequest request = + ListTopicSnapshotsRequest.newBuilder() + .setTopic(topic == null ? null : topic.toString()) + .build(); + return listTopicSnapshots(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the names of the snapshots on this topic. Snapshots are used in <a + * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment + * state of messages in an existing subscription to the state captured by a snapshot. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
+   *   for (String element : topicAdminClient.listTopicSnapshots(topic.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param topic Required. The name of the topic that snapshots are attached to. Format is + * `projects/{project}/topics/{topic}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + /* package-private */ final ListTopicSnapshotsPagedResponse listTopicSnapshots(String topic) { + ListTopicSnapshotsRequest request = + ListTopicSnapshotsRequest.newBuilder().setTopic(topic).build(); + return listTopicSnapshots(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the names of the snapshots on this topic. Snapshots are used in <a + * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment + * state of messages in an existing subscription to the state captured by a snapshot. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
+   *   ListTopicSnapshotsRequest request = ListTopicSnapshotsRequest.newBuilder()
+   *     .setTopic(topic.toString())
+   *     .build();
+   *   for (String element : topicAdminClient.listTopicSnapshots(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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 + */ + /* package-private */ final ListTopicSnapshotsPagedResponse listTopicSnapshots( + ListTopicSnapshotsRequest request) { + return listTopicSnapshotsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the names of the snapshots on this topic. Snapshots are used in <a + * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment + * state of messages in an existing subscription to the state captured by a snapshot. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
+   *   ListTopicSnapshotsRequest request = ListTopicSnapshotsRequest.newBuilder()
+   *     .setTopic(topic.toString())
+   *     .build();
+   *   ApiFuture<ListTopicSnapshotsPagedResponse> future = topicAdminClient.listTopicSnapshotsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (String element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + /* package-private */ final UnaryCallable< + ListTopicSnapshotsRequest, ListTopicSnapshotsPagedResponse> + listTopicSnapshotsPagedCallable() { + return stub.listTopicSnapshotsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists the names of the snapshots on this topic. Snapshots are used in <a + * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment + * state of messages in an existing subscription to the state captured by a snapshot. + * + *

Sample code: + * + *


+   * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+   *   TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]");
+   *   ListTopicSnapshotsRequest request = ListTopicSnapshotsRequest.newBuilder()
+   *     .setTopic(topic.toString())
+   *     .build();
+   *   while (true) {
+   *     ListTopicSnapshotsResponse response = topicAdminClient.listTopicSnapshotsCallable().call(request);
+   *     for (String element : response.getSnapshotsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + /* package-private */ final UnaryCallable + listTopicSnapshotsCallable() { + return stub.listTopicSnapshotsCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD /** * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a @@ -1016,7 +1169,7 @@ public final UnaryCallable deleteTopicCallable() { /** * Sets the access control policy on the specified resource. Replaces any existing policy. * - *

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

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. * *

Sample code: * @@ -1073,7 +1226,7 @@ public final Policy setIamPolicy(String resource, Policy policy) { /** * Sets the access control policy on the specified resource. Replaces any existing policy. * - *

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

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. * *

Sample code: * @@ -1169,7 +1322,7 @@ public final UnaryCallable getIamPolicyCallable() { // 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. + * 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 @@ -1236,7 +1389,7 @@ public final TestIamPermissionsResponse testIamPermissions( // 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. + * 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 @@ -1501,4 +1654,86 @@ public ProjectSubscriptionName apply(String arg0) { }); } } + + public static class ListTopicSnapshotsPagedResponse + extends AbstractPagedListResponse< + ListTopicSnapshotsRequest, + ListTopicSnapshotsResponse, + String, + ListTopicSnapshotsPage, + ListTopicSnapshotsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListTopicSnapshotsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListTopicSnapshotsPagedResponse apply(ListTopicSnapshotsPage input) { + return new ListTopicSnapshotsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListTopicSnapshotsPagedResponse(ListTopicSnapshotsPage page) { + super(page, ListTopicSnapshotsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListTopicSnapshotsPage + extends AbstractPage< + ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, String, ListTopicSnapshotsPage> { + + private ListTopicSnapshotsPage( + PageContext context, + ListTopicSnapshotsResponse response) { + super(context, response); + } + + private static ListTopicSnapshotsPage createEmptyPage() { + return new ListTopicSnapshotsPage(null, null); + } + + @Override + protected ListTopicSnapshotsPage createPage( + PageContext context, + ListTopicSnapshotsResponse response) { + return new ListTopicSnapshotsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListTopicSnapshotsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListTopicSnapshotsRequest, + ListTopicSnapshotsResponse, + String, + ListTopicSnapshotsPage, + ListTopicSnapshotsFixedSizeCollection> { + + private ListTopicSnapshotsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListTopicSnapshotsFixedSizeCollection createEmptyCollection() { + return new ListTopicSnapshotsFixedSizeCollection(null, 0); + } + + @Override + protected ListTopicSnapshotsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListTopicSnapshotsFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java index 9b125b8cc..59119e19b 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminSettings.java @@ -15,6 +15,7 @@ */ package com.google.cloud.pubsub.v1; +import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSnapshotsPagedResponse; import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPagedResponse; import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse; @@ -39,6 +40,8 @@ import com.google.protobuf.Empty; import com.google.pubsub.v1.DeleteTopicRequest; import com.google.pubsub.v1.GetTopicRequest; +import com.google.pubsub.v1.ListTopicSnapshotsRequest; +import com.google.pubsub.v1.ListTopicSnapshotsResponse; import com.google.pubsub.v1.ListTopicSubscriptionsRequest; import com.google.pubsub.v1.ListTopicSubscriptionsResponse; import com.google.pubsub.v1.ListTopicsRequest; @@ -119,6 +122,13 @@ public UnaryCallSettings getTopicSettings() { return ((PublisherStubSettings) getStubSettings()).listTopicSubscriptionsSettings(); } + /** Returns the object with the settings used for calls to listTopicSnapshots. */ + /* package-private */ PagedCallSettings< + ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> + listTopicSnapshotsSettings() { + return ((PublisherStubSettings) getStubSettings()).listTopicSnapshotsSettings(); + } + /** Returns the object with the settings used for calls to deleteTopic. */ public UnaryCallSettings deleteTopicSettings() { return ((PublisherStubSettings) getStubSettings()).deleteTopicSettings(); @@ -272,6 +282,13 @@ public UnaryCallSettings.Builder getTopicSettings() { return getStubSettingsBuilder().listTopicSubscriptionsSettings(); } + /** Returns the builder for the settings used for calls to listTopicSnapshots. */ + /* package-private */ PagedCallSettings.Builder< + ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> + listTopicSnapshotsSettings() { + return getStubSettingsBuilder().listTopicSnapshotsSettings(); + } + /** Returns the builder for the settings used for calls to deleteTopic. */ public UnaryCallSettings.Builder deleteTopicSettings() { return getStubSettingsBuilder().deleteTopicSettings(); diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java index f42bb6bce..02baa7378 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java @@ -15,6 +15,7 @@ */ package com.google.cloud.pubsub.v1.stub; +import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSnapshotsPagedResponse; import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPagedResponse; import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse; @@ -35,6 +36,8 @@ import com.google.protobuf.Empty; import com.google.pubsub.v1.DeleteTopicRequest; import com.google.pubsub.v1.GetTopicRequest; +import com.google.pubsub.v1.ListTopicSnapshotsRequest; +import com.google.pubsub.v1.ListTopicSnapshotsResponse; import com.google.pubsub.v1.ListTopicSubscriptionsRequest; import com.google.pubsub.v1.ListTopicSubscriptionsResponse; import com.google.pubsub.v1.ListTopicsRequest; @@ -108,6 +111,16 @@ public class GrpcPublisherStub extends PublisherStub { .setResponseMarshaller( ProtoUtils.marshaller(ListTopicSubscriptionsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + listTopicSnapshotsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.pubsub.v1.Publisher/ListTopicSnapshots") + .setRequestMarshaller( + ProtoUtils.marshaller(ListTopicSnapshotsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListTopicSnapshotsResponse.getDefaultInstance())) + .build(); private static final MethodDescriptor deleteTopicMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -152,6 +165,10 @@ public class GrpcPublisherStub extends PublisherStub { listTopicSubscriptionsCallable; private final UnaryCallable listTopicSubscriptionsPagedCallable; + private final UnaryCallable + listTopicSnapshotsCallable; + private final UnaryCallable + listTopicSnapshotsPagedCallable; private final UnaryCallable deleteTopicCallable; private final UnaryCallable setIamPolicyCallable; private final UnaryCallable getIamPolicyCallable; @@ -276,6 +293,20 @@ public Map extract(ListTopicSubscriptionsRequest request) { } }) .build(); + GrpcCallSettings + listTopicSnapshotsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listTopicSnapshotsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListTopicSnapshotsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("topic", String.valueOf(request.getTopic())); + return params.build(); + } + }) + .build(); GrpcCallSettings deleteTopicTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(deleteTopicMethodDescriptor) @@ -358,6 +389,16 @@ public Map extract(TestIamPermissionsRequest request) { listTopicSubscriptionsTransportSettings, settings.listTopicSubscriptionsSettings(), clientContext); + this.listTopicSnapshotsCallable = + callableFactory.createUnaryCallable( + listTopicSnapshotsTransportSettings, + settings.listTopicSnapshotsSettings(), + clientContext); + this.listTopicSnapshotsPagedCallable = + callableFactory.createPagedCallable( + listTopicSnapshotsTransportSettings, + settings.listTopicSnapshotsSettings(), + clientContext); this.deleteTopicCallable = callableFactory.createUnaryCallable( deleteTopicTransportSettings, settings.deleteTopicSettings(), clientContext); @@ -410,6 +451,16 @@ public UnaryCallable listTopicsCallable() return listTopicSubscriptionsCallable; } + public UnaryCallable + listTopicSnapshotsPagedCallable() { + return listTopicSnapshotsPagedCallable; + } + + public UnaryCallable + listTopicSnapshotsCallable() { + return listTopicSnapshotsCallable; + } + public UnaryCallable deleteTopicCallable() { return deleteTopicCallable; } diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java index 5b2310807..6d5ecda6e 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java @@ -38,6 +38,7 @@ import com.google.pubsub.v1.CreateSnapshotRequest; import com.google.pubsub.v1.DeleteSnapshotRequest; import com.google.pubsub.v1.DeleteSubscriptionRequest; +import com.google.pubsub.v1.GetSnapshotRequest; import com.google.pubsub.v1.GetSubscriptionRequest; import com.google.pubsub.v1.ListSnapshotsRequest; import com.google.pubsub.v1.ListSnapshotsResponse; @@ -117,6 +118,13 @@ public class GrpcSubscriberStub extends SubscriberStub { ProtoUtils.marshaller(DeleteSubscriptionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor getSnapshotMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.pubsub.v1.Subscriber/GetSnapshot") + .setRequestMarshaller(ProtoUtils.marshaller(GetSnapshotRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Snapshot.getDefaultInstance())) + .build(); private static final MethodDescriptor modifyAckDeadlineMethodDescriptor = MethodDescriptor.newBuilder() @@ -238,6 +246,7 @@ public class GrpcSubscriberStub extends SubscriberStub { private final UnaryCallable listSubscriptionsPagedCallable; private final UnaryCallable deleteSubscriptionCallable; + private final UnaryCallable getSnapshotCallable; private final UnaryCallable modifyAckDeadlineCallable; private final UnaryCallable acknowledgeCallable; private final UnaryCallable pullCallable; @@ -362,6 +371,19 @@ public Map extract(DeleteSubscriptionRequest request) { } }) .build(); + GrpcCallSettings getSnapshotTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSnapshotMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetSnapshotRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("snapshot", String.valueOf(request.getSnapshot())); + return params.build(); + } + }) + .build(); GrpcCallSettings modifyAckDeadlineTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(modifyAckDeadlineMethodDescriptor) @@ -552,6 +574,9 @@ public Map extract(TestIamPermissionsRequest request) { deleteSubscriptionTransportSettings, settings.deleteSubscriptionSettings(), clientContext); + this.getSnapshotCallable = + callableFactory.createUnaryCallable( + getSnapshotTransportSettings, settings.getSnapshotSettings(), clientContext); this.modifyAckDeadlineCallable = callableFactory.createUnaryCallable( modifyAckDeadlineTransportSettings, @@ -628,6 +653,10 @@ public UnaryCallable deleteSubscriptionCallabl return deleteSubscriptionCallable; } + public UnaryCallable getSnapshotCallable() { + return getSnapshotCallable; + } + public UnaryCallable modifyAckDeadlineCallable() { return modifyAckDeadlineCallable; } diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStub.java index 65956640f..6ff2d02f8 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStub.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStub.java @@ -15,6 +15,7 @@ */ package com.google.cloud.pubsub.v1.stub; +import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSnapshotsPagedResponse; import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPagedResponse; import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse; @@ -29,6 +30,8 @@ import com.google.protobuf.Empty; import com.google.pubsub.v1.DeleteTopicRequest; import com.google.pubsub.v1.GetTopicRequest; +import com.google.pubsub.v1.ListTopicSnapshotsRequest; +import com.google.pubsub.v1.ListTopicSnapshotsResponse; import com.google.pubsub.v1.ListTopicSubscriptionsRequest; import com.google.pubsub.v1.ListTopicSubscriptionsResponse; import com.google.pubsub.v1.ListTopicsRequest; @@ -84,6 +87,16 @@ public UnaryCallable listTopicsCallable() throw new UnsupportedOperationException("Not implemented: listTopicSubscriptionsCallable()"); } + public UnaryCallable + listTopicSnapshotsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listTopicSnapshotsPagedCallable()"); + } + + public UnaryCallable + listTopicSnapshotsCallable() { + throw new UnsupportedOperationException("Not implemented: listTopicSnapshotsCallable()"); + } + public UnaryCallable deleteTopicCallable() { throw new UnsupportedOperationException("Not implemented: deleteTopicCallable()"); } diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java index d47225785..ee84a4ab3 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java @@ -15,6 +15,7 @@ */ package com.google.cloud.pubsub.v1.stub; +import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSnapshotsPagedResponse; import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPagedResponse; import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse; @@ -60,6 +61,8 @@ import com.google.protobuf.Empty; import com.google.pubsub.v1.DeleteTopicRequest; import com.google.pubsub.v1.GetTopicRequest; +import com.google.pubsub.v1.ListTopicSnapshotsRequest; +import com.google.pubsub.v1.ListTopicSnapshotsResponse; import com.google.pubsub.v1.ListTopicSubscriptionsRequest; import com.google.pubsub.v1.ListTopicSubscriptionsResponse; import com.google.pubsub.v1.ListTopicsRequest; @@ -126,6 +129,9 @@ public class PublisherStubSettings extends StubSettings { ListTopicSubscriptionsResponse, ListTopicSubscriptionsPagedResponse> listTopicSubscriptionsSettings; + private final PagedCallSettings< + ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> + listTopicSnapshotsSettings; private final UnaryCallSettings deleteTopicSettings; private final UnaryCallSettings setIamPolicySettings; private final UnaryCallSettings getIamPolicySettings; @@ -167,6 +173,13 @@ public UnaryCallSettings getTopicSettings() { return listTopicSubscriptionsSettings; } + /** Returns the object with the settings used for calls to listTopicSnapshots. */ + public PagedCallSettings< + ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> + listTopicSnapshotsSettings() { + return listTopicSnapshotsSettings; + } + /** Returns the object with the settings used for calls to deleteTopic. */ public UnaryCallSettings deleteTopicSettings() { return deleteTopicSettings; @@ -262,6 +275,7 @@ protected PublisherStubSettings(Builder settingsBuilder) throws IOException { getTopicSettings = settingsBuilder.getTopicSettings().build(); listTopicsSettings = settingsBuilder.listTopicsSettings().build(); listTopicSubscriptionsSettings = settingsBuilder.listTopicSubscriptionsSettings().build(); + listTopicSnapshotsSettings = settingsBuilder.listTopicSnapshotsSettings().build(); deleteTopicSettings = settingsBuilder.deleteTopicSettings().build(); setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); @@ -346,6 +360,45 @@ public Iterable extractResources(ListTopicSubscriptionsResponse payload) } }; + private static final PagedListDescriptor< + ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, String> + LIST_TOPIC_SNAPSHOTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTopicSnapshotsRequest injectToken( + ListTopicSnapshotsRequest payload, String token) { + return ListTopicSnapshotsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListTopicSnapshotsRequest injectPageSize( + ListTopicSnapshotsRequest payload, int pageSize) { + return ListTopicSnapshotsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListTopicSnapshotsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTopicSnapshotsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListTopicSnapshotsResponse payload) { + return payload.getSnapshotsList() != null + ? payload.getSnapshotsList() + : ImmutableList.of(); + } + }; + private static final PagedListResponseFactory< ListTopicsRequest, ListTopicsResponse, ListTopicsPagedResponse> LIST_TOPICS_PAGE_STR_FACT = @@ -387,6 +440,27 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> + LIST_TOPIC_SNAPSHOTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTopicSnapshotsRequest, + ListTopicSnapshotsResponse, + ListTopicSnapshotsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListTopicSnapshotsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_TOPIC_SNAPSHOTS_PAGE_STR_DESC, request, context); + return ListTopicSnapshotsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + private static final BatchingDescriptor PUBLISH_BATCHING_DESC = new BatchingDescriptor() { @Override @@ -469,6 +543,9 @@ public static class Builder extends StubSettings.Builder listTopicSubscriptionsSettings; + private final PagedCallSettings.Builder< + ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> + listTopicSnapshotsSettings; private final UnaryCallSettings.Builder deleteTopicSettings; private final UnaryCallSettings.Builder setIamPolicySettings; private final UnaryCallSettings.Builder getIamPolicySettings; @@ -489,6 +566,11 @@ public static class Builder extends StubSettings.BuildernewArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "idempotent2", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); definitions.put("none", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( "publish", @@ -556,6 +638,8 @@ protected Builder(ClientContext clientContext) { listTopicSubscriptionsSettings = PagedCallSettings.newBuilder(LIST_TOPIC_SUBSCRIPTIONS_PAGE_STR_FACT); + listTopicSnapshotsSettings = PagedCallSettings.newBuilder(LIST_TOPIC_SNAPSHOTS_PAGE_STR_FACT); + deleteTopicSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -572,6 +656,7 @@ protected Builder(ClientContext clientContext) { getTopicSettings, listTopicsSettings, listTopicSubscriptionsSettings, + listTopicSnapshotsSettings, deleteTopicSettings, setIamPolicySettings, getIamPolicySettings, @@ -633,6 +718,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .listTopicSnapshotsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .deleteTopicSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -665,6 +755,7 @@ protected Builder(PublisherStubSettings settings) { getTopicSettings = settings.getTopicSettings.toBuilder(); listTopicsSettings = settings.listTopicsSettings.toBuilder(); listTopicSubscriptionsSettings = settings.listTopicSubscriptionsSettings.toBuilder(); + listTopicSnapshotsSettings = settings.listTopicSnapshotsSettings.toBuilder(); deleteTopicSettings = settings.deleteTopicSettings.toBuilder(); setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); @@ -678,6 +769,7 @@ protected Builder(PublisherStubSettings settings) { getTopicSettings, listTopicsSettings, listTopicSubscriptionsSettings, + listTopicSnapshotsSettings, deleteTopicSettings, setIamPolicySettings, getIamPolicySettings, @@ -735,6 +827,13 @@ public UnaryCallSettings.Builder getTopicSettings() { return listTopicSubscriptionsSettings; } + /** Returns the builder for the settings used for calls to listTopicSnapshots. */ + public PagedCallSettings.Builder< + ListTopicSnapshotsRequest, ListTopicSnapshotsResponse, ListTopicSnapshotsPagedResponse> + listTopicSnapshotsSettings() { + return listTopicSnapshotsSettings; + } + /** Returns the builder for the settings used for calls to deleteTopic. */ public UnaryCallSettings.Builder deleteTopicSettings() { return deleteTopicSettings; diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStub.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStub.java index 66f365ee0..da19f2a6f 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStub.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStub.java @@ -32,6 +32,7 @@ import com.google.pubsub.v1.CreateSnapshotRequest; import com.google.pubsub.v1.DeleteSnapshotRequest; import com.google.pubsub.v1.DeleteSubscriptionRequest; +import com.google.pubsub.v1.GetSnapshotRequest; import com.google.pubsub.v1.GetSubscriptionRequest; import com.google.pubsub.v1.ListSnapshotsRequest; import com.google.pubsub.v1.ListSnapshotsResponse; @@ -87,6 +88,10 @@ public UnaryCallable deleteSubscriptionCallabl throw new UnsupportedOperationException("Not implemented: deleteSubscriptionCallable()"); } + public UnaryCallable getSnapshotCallable() { + throw new UnsupportedOperationException("Not implemented: getSnapshotCallable()"); + } + public UnaryCallable modifyAckDeadlineCallable() { throw new UnsupportedOperationException("Not implemented: modifyAckDeadlineCallable()"); } diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java index 2b2276135..a6d1a9826 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java @@ -55,6 +55,7 @@ import com.google.pubsub.v1.CreateSnapshotRequest; import com.google.pubsub.v1.DeleteSnapshotRequest; import com.google.pubsub.v1.DeleteSubscriptionRequest; +import com.google.pubsub.v1.GetSnapshotRequest; import com.google.pubsub.v1.GetSubscriptionRequest; import com.google.pubsub.v1.ListSnapshotsRequest; import com.google.pubsub.v1.ListSnapshotsResponse; @@ -125,6 +126,7 @@ public class SubscriberStubSettings extends StubSettings ListSubscriptionsRequest, ListSubscriptionsResponse, ListSubscriptionsPagedResponse> listSubscriptionsSettings; private final UnaryCallSettings deleteSubscriptionSettings; + private final UnaryCallSettings getSnapshotSettings; private final UnaryCallSettings modifyAckDeadlineSettings; private final UnaryCallSettings acknowledgeSettings; private final UnaryCallSettings pullSettings; @@ -170,6 +172,11 @@ public UnaryCallSettings deleteSubscriptionSet return deleteSubscriptionSettings; } + /** Returns the object with the settings used for calls to getSnapshot. */ + public UnaryCallSettings getSnapshotSettings() { + return getSnapshotSettings; + } + /** Returns the object with the settings used for calls to modifyAckDeadline. */ public UnaryCallSettings modifyAckDeadlineSettings() { return modifyAckDeadlineSettings; @@ -311,6 +318,7 @@ protected SubscriberStubSettings(Builder settingsBuilder) throws IOException { updateSubscriptionSettings = settingsBuilder.updateSubscriptionSettings().build(); listSubscriptionsSettings = settingsBuilder.listSubscriptionsSettings().build(); deleteSubscriptionSettings = settingsBuilder.deleteSubscriptionSettings().build(); + getSnapshotSettings = settingsBuilder.getSnapshotSettings().build(); modifyAckDeadlineSettings = settingsBuilder.modifyAckDeadlineSettings().build(); acknowledgeSettings = settingsBuilder.acknowledgeSettings().build(); pullSettings = settingsBuilder.pullSettings().build(); @@ -454,6 +462,7 @@ public static class Builder extends StubSettings.Builder deleteSubscriptionSettings; + private final UnaryCallSettings.Builder getSnapshotSettings; private final UnaryCallSettings.Builder modifyAckDeadlineSettings; private final UnaryCallSettings.Builder acknowledgeSettings; @@ -488,6 +497,11 @@ public static class Builder extends StubSettings.BuildernewArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "idempotent2", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); definitions.put( "streaming_pull", ImmutableSet.copyOf( @@ -558,6 +572,8 @@ protected Builder(ClientContext clientContext) { deleteSubscriptionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSnapshotSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + modifyAckDeadlineSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); acknowledgeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -591,6 +607,7 @@ protected Builder(ClientContext clientContext) { updateSubscriptionSettings, listSubscriptionsSettings, deleteSubscriptionSettings, + getSnapshotSettings, modifyAckDeadlineSettings, acknowledgeSettings, pullSettings, @@ -643,6 +660,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .getSnapshotSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent2")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .modifyAckDeadlineSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) @@ -714,6 +736,7 @@ protected Builder(SubscriberStubSettings settings) { updateSubscriptionSettings = settings.updateSubscriptionSettings.toBuilder(); listSubscriptionsSettings = settings.listSubscriptionsSettings.toBuilder(); deleteSubscriptionSettings = settings.deleteSubscriptionSettings.toBuilder(); + getSnapshotSettings = settings.getSnapshotSettings.toBuilder(); modifyAckDeadlineSettings = settings.modifyAckDeadlineSettings.toBuilder(); acknowledgeSettings = settings.acknowledgeSettings.toBuilder(); pullSettings = settings.pullSettings.toBuilder(); @@ -735,6 +758,7 @@ protected Builder(SubscriberStubSettings settings) { updateSubscriptionSettings, listSubscriptionsSettings, deleteSubscriptionSettings, + getSnapshotSettings, modifyAckDeadlineSettings, acknowledgeSettings, pullSettings, @@ -795,6 +819,11 @@ public UnaryCallSettings.Builder createSubscriptionS return deleteSubscriptionSettings; } + /** Returns the builder for the settings used for calls to getSnapshot. */ + public UnaryCallSettings.Builder getSnapshotSettings() { + return getSnapshotSettings; + } + /** Returns the builder for the settings used for calls to modifyAckDeadline. */ public UnaryCallSettings.Builder modifyAckDeadlineSettings() { return modifyAckDeadlineSettings; diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockPublisherImpl.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockPublisherImpl.java index a8c18fb04..0d49c4288 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockPublisherImpl.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockPublisherImpl.java @@ -20,6 +20,8 @@ import com.google.protobuf.Empty; import com.google.pubsub.v1.DeleteTopicRequest; import com.google.pubsub.v1.GetTopicRequest; +import com.google.pubsub.v1.ListTopicSnapshotsRequest; +import com.google.pubsub.v1.ListTopicSnapshotsResponse; import com.google.pubsub.v1.ListTopicSubscriptionsRequest; import com.google.pubsub.v1.ListTopicSubscriptionsResponse; import com.google.pubsub.v1.ListTopicsRequest; @@ -154,6 +156,22 @@ public void listTopicSubscriptions( } } + @Override + public void listTopicSnapshots( + ListTopicSnapshotsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListTopicSnapshotsResponse) { + requests.add(request); + responseObserver.onNext((ListTopicSnapshotsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + @Override public void deleteTopic(DeleteTopicRequest request, StreamObserver responseObserver) { Object response = responses.remove(); diff --git a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSubscriberImpl.java b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSubscriberImpl.java index 2e9e647e6..3d3c2013d 100644 --- a/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSubscriberImpl.java +++ b/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/MockSubscriberImpl.java @@ -22,6 +22,7 @@ import com.google.pubsub.v1.CreateSnapshotRequest; import com.google.pubsub.v1.DeleteSnapshotRequest; import com.google.pubsub.v1.DeleteSubscriptionRequest; +import com.google.pubsub.v1.GetSnapshotRequest; import com.google.pubsub.v1.GetSubscriptionRequest; import com.google.pubsub.v1.ListSnapshotsRequest; import com.google.pubsub.v1.ListSnapshotsResponse; @@ -200,11 +201,12 @@ public void pull(PullRequest request, StreamObserver responseObser @Override public StreamObserver streamingPull( final StreamObserver responseObserver) { - final Object response = responses.remove(); StreamObserver requestObserver = new StreamObserver() { @Override public void onNext(StreamingPullRequest value) { + requests.add(value); + final Object response = responses.remove(); if (response instanceof StreamingPullResponse) { responseObserver.onNext((StreamingPullResponse) response); } else if (response instanceof Exception) { @@ -242,6 +244,20 @@ public void modifyPushConfig( } } + @Override + public void getSnapshot(GetSnapshotRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Snapshot) { + requests.add(request); + responseObserver.onNext((Snapshot) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + @Override public void listSnapshots( ListSnapshotsRequest request, StreamObserver responseObserver) { 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 bfe959b50..2d40f14bf 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 @@ -45,6 +45,7 @@ import com.google.pubsub.v1.CreateSnapshotRequest; import com.google.pubsub.v1.DeleteSnapshotRequest; import com.google.pubsub.v1.DeleteSubscriptionRequest; +import com.google.pubsub.v1.GetSnapshotRequest; import com.google.pubsub.v1.GetSubscriptionRequest; import com.google.pubsub.v1.ListSnapshotsRequest; import com.google.pubsub.v1.ListSnapshotsResponse; @@ -404,6 +405,47 @@ public void deleteSubscriptionExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void getSnapshotTest() { + ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); + Snapshot expectedResponse = + Snapshot.newBuilder().setName(name.toString()).setTopic(topic.toString()).build(); + mockSubscriber.addResponse(expectedResponse); + + ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + + Snapshot actualResponse = client.getSnapshot(snapshot); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSubscriber.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSnapshotRequest actualRequest = (GetSnapshotRequest) actualRequests.get(0); + + Assert.assertEquals(snapshot, ProjectSnapshotName.parse(actualRequest.getSnapshot())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getSnapshotExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockSubscriber.addException(exception); + + try { + ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + + client.getSnapshot(snapshot); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void modifyAckDeadlineTest() { 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 7d524361b..43510c154 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 @@ -15,6 +15,7 @@ */ package com.google.cloud.pubsub.v1; +import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSnapshotsPagedResponse; import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicSubscriptionsPagedResponse; import static com.google.cloud.pubsub.v1.TopicAdminClient.ListTopicsPagedResponse; @@ -38,6 +39,8 @@ import com.google.protobuf.FieldMask; import com.google.pubsub.v1.DeleteTopicRequest; import com.google.pubsub.v1.GetTopicRequest; +import com.google.pubsub.v1.ListTopicSnapshotsRequest; +import com.google.pubsub.v1.ListTopicSnapshotsResponse; import com.google.pubsub.v1.ListTopicSubscriptionsRequest; import com.google.pubsub.v1.ListTopicSubscriptionsResponse; import com.google.pubsub.v1.ListTopicsRequest; @@ -390,6 +393,54 @@ public void listTopicSubscriptionsExceptionTest() throws Exception { } } + @Test + @SuppressWarnings("all") + public void listTopicSnapshotsTest() { + String nextPageToken = ""; + String snapshotsElement = "snapshotsElement1339034092"; + List snapshots = Arrays.asList(snapshotsElement); + ListTopicSnapshotsResponse expectedResponse = + ListTopicSnapshotsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllSnapshots(snapshots) + .build(); + mockPublisher.addResponse(expectedResponse); + + TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); + + ListTopicSnapshotsPagedResponse pagedListResponse = client.listTopicSnapshots(topic); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSnapshotsList().get(0), resources.get(0)); + + List actualRequests = mockPublisher.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTopicSnapshotsRequest actualRequest = (ListTopicSnapshotsRequest) actualRequests.get(0); + + Assert.assertEquals(topic, TopicName.parse(actualRequest.getTopic())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listTopicSnapshotsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockPublisher.addException(exception); + + try { + TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); + + client.listTopicSnapshots(topic); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + @Test @SuppressWarnings("all") public void deleteTopicTest() { diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfig.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfig.java index e461881d5..5557855c8 100644 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfig.java +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfig.java @@ -1140,7 +1140,7 @@ public AuthenticationMethodCase getAuthenticationMethodCase() { * *

    * A URL locating the endpoint to which messages should be pushed.
-   * For example, a Webhook endpoint might use "https://example.com/push".
+   * For example, a Webhook endpoint might use `https://example.com/push`.
    * 
* * string push_endpoint = 1; @@ -1163,7 +1163,7 @@ public java.lang.String getPushEndpoint() { * *
    * A URL locating the endpoint to which messages should be pushed.
-   * For example, a Webhook endpoint might use "https://example.com/push".
+   * For example, a Webhook endpoint might use `https://example.com/push`.
    * 
* * string push_endpoint = 1; @@ -1808,7 +1808,7 @@ public Builder clearAuthenticationMethod() { * *
      * A URL locating the endpoint to which messages should be pushed.
-     * For example, a Webhook endpoint might use "https://example.com/push".
+     * For example, a Webhook endpoint might use `https://example.com/push`.
      * 
* * string push_endpoint = 1; @@ -1831,7 +1831,7 @@ public java.lang.String getPushEndpoint() { * *
      * A URL locating the endpoint to which messages should be pushed.
-     * For example, a Webhook endpoint might use "https://example.com/push".
+     * For example, a Webhook endpoint might use `https://example.com/push`.
      * 
* * string push_endpoint = 1; @@ -1854,7 +1854,7 @@ public com.google.protobuf.ByteString getPushEndpointBytes() { * *
      * A URL locating the endpoint to which messages should be pushed.
-     * For example, a Webhook endpoint might use "https://example.com/push".
+     * For example, a Webhook endpoint might use `https://example.com/push`.
      * 
* * string push_endpoint = 1; @@ -1876,7 +1876,7 @@ public Builder setPushEndpoint(java.lang.String value) { * *
      * A URL locating the endpoint to which messages should be pushed.
-     * For example, a Webhook endpoint might use "https://example.com/push".
+     * For example, a Webhook endpoint might use `https://example.com/push`.
      * 
* * string push_endpoint = 1; @@ -1894,7 +1894,7 @@ public Builder clearPushEndpoint() { * *
      * A URL locating the endpoint to which messages should be pushed.
-     * For example, a Webhook endpoint might use "https://example.com/push".
+     * For example, a Webhook endpoint might use `https://example.com/push`.
      * 
* * string push_endpoint = 1; diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfigOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfigOrBuilder.java index 873e0074a..091a066f9 100644 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfigOrBuilder.java +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/PushConfigOrBuilder.java @@ -28,7 +28,7 @@ public interface PushConfigOrBuilder * *
    * A URL locating the endpoint to which messages should be pushed.
-   * For example, a Webhook endpoint might use "https://example.com/push".
+   * For example, a Webhook endpoint might use `https://example.com/push`.
    * 
* * string push_endpoint = 1; @@ -41,7 +41,7 @@ public interface PushConfigOrBuilder * *
    * A URL locating the endpoint to which messages should be pushed.
-   * For example, a Webhook endpoint might use "https://example.com/push".
+   * For example, a Webhook endpoint might use `https://example.com/push`.
    * 
* * string push_endpoint = 1; diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessage.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessage.java index b366d91da..298013f30 100644 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessage.java +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessage.java @@ -227,19 +227,18 @@ public com.google.pubsub.v1.PubsubMessageOrBuilder getMessageOrBuilder() { * * *
-   * Delivery attempt counter is 1 + (the sum of number of NACKs and number of
-   * ack_deadline exceeds) for this message.
+   * The approximate number of times that Cloud Pub/Sub has attempted to deliver
+   * the associated message to a subscriber.
+   * More precisely, this is 1 + (number of NACKs) +
+   * (number of ack_deadline exceeds) for this message.
    * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
    * exceeds event is whenever a message is not acknowledged within
    * ack_deadline. Note that ack_deadline is initially
    * Subscription.ackDeadlineSeconds, but may get extended automatically by
    * the client library.
-   * The first delivery of a given message will have this value as 1. The value
-   * is calculated at best effort and is approximate.
+   * Upon the first delivery of a given message, `delivery_attempt` will have a
+   * value of 1. The value is calculated at best effort and is approximate.
    * If a DeadLetterPolicy is not set on the subscription, this will be 0.
-   * <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.
    * 
* * int32 delivery_attempt = 3; @@ -902,19 +901,18 @@ public com.google.pubsub.v1.PubsubMessageOrBuilder getMessageOrBuilder() { * * *
-     * Delivery attempt counter is 1 + (the sum of number of NACKs and number of
-     * ack_deadline exceeds) for this message.
+     * The approximate number of times that Cloud Pub/Sub has attempted to deliver
+     * the associated message to a subscriber.
+     * More precisely, this is 1 + (number of NACKs) +
+     * (number of ack_deadline exceeds) for this message.
      * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
      * exceeds event is whenever a message is not acknowledged within
      * ack_deadline. Note that ack_deadline is initially
      * Subscription.ackDeadlineSeconds, but may get extended automatically by
      * the client library.
-     * The first delivery of a given message will have this value as 1. The value
-     * is calculated at best effort and is approximate.
+     * Upon the first delivery of a given message, `delivery_attempt` will have a
+     * value of 1. The value is calculated at best effort and is approximate.
      * If a DeadLetterPolicy is not set on the subscription, this will be 0.
-     * <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.
      * 
* * int32 delivery_attempt = 3; @@ -928,19 +926,18 @@ public int getDeliveryAttempt() { * * *
-     * Delivery attempt counter is 1 + (the sum of number of NACKs and number of
-     * ack_deadline exceeds) for this message.
+     * The approximate number of times that Cloud Pub/Sub has attempted to deliver
+     * the associated message to a subscriber.
+     * More precisely, this is 1 + (number of NACKs) +
+     * (number of ack_deadline exceeds) for this message.
      * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
      * exceeds event is whenever a message is not acknowledged within
      * ack_deadline. Note that ack_deadline is initially
      * Subscription.ackDeadlineSeconds, but may get extended automatically by
      * the client library.
-     * The first delivery of a given message will have this value as 1. The value
-     * is calculated at best effort and is approximate.
+     * Upon the first delivery of a given message, `delivery_attempt` will have a
+     * value of 1. The value is calculated at best effort and is approximate.
      * If a DeadLetterPolicy is not set on the subscription, this will be 0.
-     * <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.
      * 
* * int32 delivery_attempt = 3; @@ -958,19 +955,18 @@ public Builder setDeliveryAttempt(int value) { * * *
-     * Delivery attempt counter is 1 + (the sum of number of NACKs and number of
-     * ack_deadline exceeds) for this message.
+     * The approximate number of times that Cloud Pub/Sub has attempted to deliver
+     * the associated message to a subscriber.
+     * More precisely, this is 1 + (number of NACKs) +
+     * (number of ack_deadline exceeds) for this message.
      * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
      * exceeds event is whenever a message is not acknowledged within
      * ack_deadline. Note that ack_deadline is initially
      * Subscription.ackDeadlineSeconds, but may get extended automatically by
      * the client library.
-     * The first delivery of a given message will have this value as 1. The value
-     * is calculated at best effort and is approximate.
+     * Upon the first delivery of a given message, `delivery_attempt` will have a
+     * value of 1. The value is calculated at best effort and is approximate.
      * If a DeadLetterPolicy is not set on the subscription, this will be 0.
-     * <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.
      * 
* * int32 delivery_attempt = 3; diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessageOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessageOrBuilder.java index eb54e43f1..805690b39 100644 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessageOrBuilder.java +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/ReceivedMessageOrBuilder.java @@ -87,19 +87,18 @@ public interface ReceivedMessageOrBuilder * * *
-   * Delivery attempt counter is 1 + (the sum of number of NACKs and number of
-   * ack_deadline exceeds) for this message.
+   * The approximate number of times that Cloud Pub/Sub has attempted to deliver
+   * the associated message to a subscriber.
+   * More precisely, this is 1 + (number of NACKs) +
+   * (number of ack_deadline exceeds) for this message.
    * A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline
    * exceeds event is whenever a message is not acknowledged within
    * ack_deadline. Note that ack_deadline is initially
    * Subscription.ackDeadlineSeconds, but may get extended automatically by
    * the client library.
-   * The first delivery of a given message will have this value as 1. The value
-   * is calculated at best effort and is approximate.
+   * Upon the first delivery of a given message, `delivery_attempt` will have a
+   * value of 1. The value is calculated at best effort and is approximate.
    * If a DeadLetterPolicy is not set on the subscription, this will be 0.
-   * <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.
    * 
* * int32 delivery_attempt = 3; 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 c91b6d10f..64391376b 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 @@ -773,9 +773,6 @@ public com.google.protobuf.ByteString getFilterBytes() { * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; @@ -796,9 +793,6 @@ public boolean hasDeadLetterPolicy() { * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; @@ -821,9 +815,6 @@ public com.google.pubsub.v1.DeadLetterPolicy getDeadLetterPolicy() { * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; @@ -2948,9 +2939,6 @@ public Builder setFilterBytes(com.google.protobuf.ByteString value) { * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; @@ -2971,9 +2959,6 @@ public boolean hasDeadLetterPolicy() { * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; @@ -3000,9 +2985,6 @@ public com.google.pubsub.v1.DeadLetterPolicy getDeadLetterPolicy() { * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; @@ -3031,9 +3013,6 @@ public Builder setDeadLetterPolicy(com.google.pubsub.v1.DeadLetterPolicy value) * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; @@ -3060,9 +3039,6 @@ public Builder setDeadLetterPolicy( * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; @@ -3095,9 +3071,6 @@ public Builder mergeDeadLetterPolicy(com.google.pubsub.v1.DeadLetterPolicy value * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; @@ -3124,9 +3097,6 @@ public Builder clearDeadLetterPolicy() { * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; @@ -3147,9 +3117,6 @@ public com.google.pubsub.v1.DeadLetterPolicy.Builder getDeadLetterPolicyBuilder( * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; @@ -3174,9 +3141,6 @@ public com.google.pubsub.v1.DeadLetterPolicyOrBuilder getDeadLetterPolicyOrBuild * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; 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 0c1a6fe40..dd48671fb 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 @@ -406,9 +406,6 @@ public interface SubscriptionOrBuilder * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; @@ -427,9 +424,6 @@ public interface SubscriptionOrBuilder * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; @@ -448,9 +442,6 @@ public interface SubscriptionOrBuilder * parent project (i.e., * service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have * permission to Acknowledge() messages on this subscription. - * <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. * * * .google.pubsub.v1.DeadLetterPolicy dead_letter_policy = 13; 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 09996bf5e..14d871ac5 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 @@ -22,8 +22,6 @@ 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; @@ -119,28 +117,6 @@ public static TopicName parse(String formattedString) { 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); diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequest.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequest.java index 5309c9bd7..44b586ae1 100644 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequest.java +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequest.java @@ -182,9 +182,9 @@ public com.google.pubsub.v1.TopicOrBuilder getTopicOrBuilder() { *
    * Required. Indicates which fields in the provided topic to update. Must be
    * specified and non-empty. Note that if `update_mask` contains
-   * "message_storage_policy" then the new value will be determined based on the
-   * policy configured at the project or organization level. The
-   * `message_storage_policy` must not be set in the `topic` provided above.
+   * "message_storage_policy" but the `message_storage_policy` is not set in
+   * the `topic` provided above, then the updated value is determined by the
+   * policy configured at the project or organization level.
    * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -201,9 +201,9 @@ public boolean hasUpdateMask() { *
    * Required. Indicates which fields in the provided topic to update. Must be
    * specified and non-empty. Note that if `update_mask` contains
-   * "message_storage_policy" then the new value will be determined based on the
-   * policy configured at the project or organization level. The
-   * `message_storage_policy` must not be set in the `topic` provided above.
+   * "message_storage_policy" but the `message_storage_policy` is not set in
+   * the `topic` provided above, then the updated value is determined by the
+   * policy configured at the project or organization level.
    * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -220,9 +220,9 @@ public com.google.protobuf.FieldMask getUpdateMask() { *
    * Required. Indicates which fields in the provided topic to update. Must be
    * specified and non-empty. Note that if `update_mask` contains
-   * "message_storage_policy" then the new value will be determined based on the
-   * policy configured at the project or organization level. The
-   * `message_storage_policy` must not be set in the `topic` provided above.
+   * "message_storage_policy" but the `message_storage_policy` is not set in
+   * the `topic` provided above, then the updated value is determined by the
+   * policy configured at the project or organization level.
    * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -776,9 +776,9 @@ public com.google.pubsub.v1.TopicOrBuilder getTopicOrBuilder() { *
      * Required. Indicates which fields in the provided topic to update. Must be
      * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" then the new value will be determined based on the
-     * policy configured at the project or organization level. The
-     * `message_storage_policy` must not be set in the `topic` provided above.
+     * "message_storage_policy" but the `message_storage_policy` is not set in
+     * the `topic` provided above, then the updated value is determined by the
+     * policy configured at the project or organization level.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -795,9 +795,9 @@ public boolean hasUpdateMask() { *
      * Required. Indicates which fields in the provided topic to update. Must be
      * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" then the new value will be determined based on the
-     * policy configured at the project or organization level. The
-     * `message_storage_policy` must not be set in the `topic` provided above.
+     * "message_storage_policy" but the `message_storage_policy` is not set in
+     * the `topic` provided above, then the updated value is determined by the
+     * policy configured at the project or organization level.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -820,9 +820,9 @@ public com.google.protobuf.FieldMask getUpdateMask() { *
      * Required. Indicates which fields in the provided topic to update. Must be
      * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" then the new value will be determined based on the
-     * policy configured at the project or organization level. The
-     * `message_storage_policy` must not be set in the `topic` provided above.
+     * "message_storage_policy" but the `message_storage_policy` is not set in
+     * the `topic` provided above, then the updated value is determined by the
+     * policy configured at the project or organization level.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -847,9 +847,9 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { *
      * Required. Indicates which fields in the provided topic to update. Must be
      * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" then the new value will be determined based on the
-     * policy configured at the project or organization level. The
-     * `message_storage_policy` must not be set in the `topic` provided above.
+     * "message_storage_policy" but the `message_storage_policy` is not set in
+     * the `topic` provided above, then the updated value is determined by the
+     * policy configured at the project or organization level.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -871,9 +871,9 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal *
      * Required. Indicates which fields in the provided topic to update. Must be
      * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" then the new value will be determined based on the
-     * policy configured at the project or organization level. The
-     * `message_storage_policy` must not be set in the `topic` provided above.
+     * "message_storage_policy" but the `message_storage_policy` is not set in
+     * the `topic` provided above, then the updated value is determined by the
+     * policy configured at the project or organization level.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -900,9 +900,9 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { *
      * Required. Indicates which fields in the provided topic to update. Must be
      * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" then the new value will be determined based on the
-     * policy configured at the project or organization level. The
-     * `message_storage_policy` must not be set in the `topic` provided above.
+     * "message_storage_policy" but the `message_storage_policy` is not set in
+     * the `topic` provided above, then the updated value is determined by the
+     * policy configured at the project or organization level.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -925,9 +925,9 @@ public Builder clearUpdateMask() { *
      * Required. Indicates which fields in the provided topic to update. Must be
      * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" then the new value will be determined based on the
-     * policy configured at the project or organization level. The
-     * `message_storage_policy` must not be set in the `topic` provided above.
+     * "message_storage_policy" but the `message_storage_policy` is not set in
+     * the `topic` provided above, then the updated value is determined by the
+     * policy configured at the project or organization level.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -944,9 +944,9 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { *
      * Required. Indicates which fields in the provided topic to update. Must be
      * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" then the new value will be determined based on the
-     * policy configured at the project or organization level. The
-     * `message_storage_policy` must not be set in the `topic` provided above.
+     * "message_storage_policy" but the `message_storage_policy` is not set in
+     * the `topic` provided above, then the updated value is determined by the
+     * policy configured at the project or organization level.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -967,9 +967,9 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { *
      * Required. Indicates which fields in the provided topic to update. Must be
      * specified and non-empty. Note that if `update_mask` contains
-     * "message_storage_policy" then the new value will be determined based on the
-     * policy configured at the project or organization level. The
-     * `message_storage_policy` must not be set in the `topic` provided above.
+     * "message_storage_policy" but the `message_storage_policy` is not set in
+     * the `topic` provided above, then the updated value is determined by the
+     * policy configured at the project or organization level.
      * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; diff --git a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequestOrBuilder.java b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequestOrBuilder.java index 257f0fdb8..c65735f57 100644 --- a/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequestOrBuilder.java +++ b/proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/UpdateTopicRequestOrBuilder.java @@ -64,9 +64,9 @@ public interface UpdateTopicRequestOrBuilder *
    * Required. Indicates which fields in the provided topic to update. Must be
    * specified and non-empty. Note that if `update_mask` contains
-   * "message_storage_policy" then the new value will be determined based on the
-   * policy configured at the project or organization level. The
-   * `message_storage_policy` must not be set in the `topic` provided above.
+   * "message_storage_policy" but the `message_storage_policy` is not set in
+   * the `topic` provided above, then the updated value is determined by the
+   * policy configured at the project or organization level.
    * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -81,9 +81,9 @@ public interface UpdateTopicRequestOrBuilder *
    * Required. Indicates which fields in the provided topic to update. Must be
    * specified and non-empty. Note that if `update_mask` contains
-   * "message_storage_policy" then the new value will be determined based on the
-   * policy configured at the project or organization level. The
-   * `message_storage_policy` must not be set in the `topic` provided above.
+   * "message_storage_policy" but the `message_storage_policy` is not set in
+   * the `topic` provided above, then the updated value is determined by the
+   * policy configured at the project or organization level.
    * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; @@ -98,9 +98,9 @@ public interface UpdateTopicRequestOrBuilder *
    * Required. Indicates which fields in the provided topic to update. Must be
    * specified and non-empty. Note that if `update_mask` contains
-   * "message_storage_policy" then the new value will be determined based on the
-   * policy configured at the project or organization level. The
-   * `message_storage_policy` must not be set in the `topic` provided above.
+   * "message_storage_policy" but the `message_storage_policy` is not set in
+   * the `topic` provided above, then the updated value is determined by the
+   * policy configured at the project or organization level.
    * 
* * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = REQUIRED]; 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 b49b30ed4..a42d03220 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 @@ -222,9 +222,9 @@ message UpdateTopicRequest { // Required. Indicates which fields in the provided topic to update. Must be // specified and non-empty. Note that if `update_mask` contains - // "message_storage_policy" then the new value will be determined based on the - // policy configured at the project or organization level. The - // `message_storage_policy` must not be set in the `topic` provided above. + // "message_storage_policy" but the `message_storage_policy` is not set in + // the `topic` provided above, then the updated value is determined by the + // policy configured at the project or organization level. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -689,9 +689,6 @@ message Subscription { // parent project (i.e., // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have // permission to Acknowledge() messages on this subscription. - // 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. DeadLetterPolicy dead_letter_policy = 13; // A policy that specifies how Cloud Pub/Sub retries message delivery for this @@ -796,7 +793,7 @@ message PushConfig { } // A URL locating the endpoint to which messages should be pushed. - // For example, a Webhook endpoint might use "https://example.com/push". + // For example, a Webhook endpoint might use `https://example.com/push`. string push_endpoint = 1; // Endpoint configuration attributes that can be used to control different @@ -842,8 +839,11 @@ message ReceivedMessage { // The message. PubsubMessage message = 2; - // Delivery attempt counter is 1 + (the sum of number of NACKs and number of - // ack_deadline exceeds) for this message. + // The approximate number of times that Cloud Pub/Sub has attempted to deliver + // the associated message to a subscriber. + // + // More precisely, this is 1 + (number of NACKs) + + // (number of ack_deadline exceeds) for this message. // // A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline // exceeds event is whenever a message is not acknowledged within @@ -851,13 +851,10 @@ message ReceivedMessage { // Subscription.ackDeadlineSeconds, but may get extended automatically by // the client library. // - // The first delivery of a given message will have this value as 1. The value - // is calculated at best effort and is approximate. + // Upon the first delivery of a given message, `delivery_attempt` will have a + // value of 1. The value is calculated at best effort and is approximate. // // If a DeadLetterPolicy is not set on the subscription, this will be 0. - // 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. int32 delivery_attempt = 3; } diff --git a/synth.metadata b/synth.metadata index a508982a7..4effe7abd 100644 --- a/synth.metadata +++ b/synth.metadata @@ -3,23 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/java-pubsub.git", - "sha": "b4e0b77255ebb04eead8bf3e5c7be0fe76ac4c89" + "remote": "https://github.com/googleapis/java-pubsub.git", + "sha": "e1d285147accf85dc47417646388b8298f8c484e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b5e9b0b09cc15c263f07da92fa64db31b2e4dd07", - "internalRef": "307068250" + "sha": "edd3b80fb770548d6ad780105f1782de6ff73ea0", + "internalRef": "311053644" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "f8a9933e5e98202b04ef427f28d1d79221190fa4" + "sha": "5b48b0716a36ca069db3038da7e205c87a22ed19" } } ],