diff --git a/README.md b/README.md index 06de7314a..940f97b9d 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ If you are using Maven without the BOM, add this to your dependencies: If you are using Gradle 5.x or later, add this to your dependencies: ```Groovy -implementation platform('com.google.cloud:libraries-bom:26.24.0') +implementation platform('com.google.cloud:libraries-bom:26.25.0') implementation 'com.google.cloud:google-cloud-pubsub' ``` diff --git a/owl-bot-staging/v1/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceClient.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceClient.java similarity index 100% rename from owl-bot-staging/v1/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceClient.java rename to google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceClient.java diff --git a/owl-bot-staging/v1/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java similarity index 99% rename from owl-bot-staging/v1/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java rename to google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java index 06e321094..67d08bb63 100644 --- a/owl-bot-staging/v1/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SchemaServiceSettings.java @@ -29,7 +29,6 @@ import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.pubsub.v1.stub.SchemaServiceStubSettings; diff --git a/owl-bot-staging/v1/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 similarity index 78% rename from owl-bot-staging/v1/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java rename to google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java index dbb9758a3..068970f64 100644 --- a/owl-bot-staging/v1/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 @@ -48,6 +48,9 @@ import com.google.pubsub.v1.ModifyAckDeadlineRequest; import com.google.pubsub.v1.ModifyPushConfigRequest; import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.ProjectSnapshotName; +import com.google.pubsub.v1.ProjectSubscriptionName; +import com.google.pubsub.v1.ProjectTopicName; import com.google.pubsub.v1.PullRequest; import com.google.pubsub.v1.PullResponse; import com.google.pubsub.v1.PushConfig; @@ -549,6 +552,216 @@ public final Subscription createSubscription(Subscription request) { return createSubscriptionCallable().call(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a subscription to a given topic. See the <a + * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name + * rules</a>. If the subscription already exists, returns `ALREADY_EXISTS`. If the + * corresponding topic doesn't exist, returns `NOT_FOUND`. + * + *
If the name is not provided in the request, the server will assign a random name for this + * subscription on the same project as the topic, conforming to the [resource name + * format](https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is + * populated in the returned Subscription object. Note that for REST API requests, you must + * specify a name in the request. + * + *
Sample code: + * + *
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]");
+ * ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+ * PushConfig pushConfig = PushConfig.newBuilder().build();
+ * int ackDeadlineSeconds = 0;
+ * Subscription response = subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds);
+ * }
+ *
+ *
+ * @param name Required. The name of the subscription. It must have the format
+ * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a
+ * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores
+ * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3
+ * and 255 characters in length, and it must not start with `"goog"`.
+ * @param topic Required. The name of the topic from which this subscription is receiving
+ * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be
+ * `_deleted-topic_` if the topic has been deleted.
+ * @param pushConfig If push delivery is used with this subscription, this field is used to
+ * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack
+ * messages using API methods.
+ * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits
+ * for the subscriber to acknowledge receipt before resending the message. In the interval
+ * after the message is delivered and before it is acknowledged, it is considered to be
+ * <i>outstanding</i>. During that time period, the message will not be
+ * redelivered (on a best-effort basis).
+ * For pull subscriptions, this value is used as the initial value for the ack deadline. To + * override this value for a given message, call `ModifyAckDeadline` with the corresponding + * `ack_id` if using non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline + * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds + * (10 minutes). If this parameter is 0, a default value of 10 seconds is used. + *
For push delivery, this value is also used to set the request timeout for the call to + * the push endpoint. + *
If the subscriber never acknowledges the message, the Pub/Sub system will eventually + * redeliver the message. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #createSubscription(SubscriptionName, TopicName, PushConfig, int)} + * instead. + */ + @Deprecated + public final Subscription createSubscription( + ProjectSubscriptionName name, + ProjectTopicName topic, + PushConfig pushConfig, + int ackDeadlineSeconds) { + Subscription request = + Subscription.newBuilder() + .setName(name == null ? null : name.toString()) + .setTopic(topic == null ? null : topic.toString()) + .setPushConfig(pushConfig) + .setAckDeadlineSeconds(ackDeadlineSeconds) + .build(); + return createSubscription(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a subscription to a given topic. See the [resource name rules] + * (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already + * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns + * `NOT_FOUND`. + * + *
If the name is not provided in the request, the server will assign a random name for this + * subscription on the same project as the topic, conforming to the [resource name format] + * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in + * the returned Subscription object. Note that for REST API requests, you must specify a name in + * the request. + * + *
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + * String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString(); + * PushConfig pushConfig = PushConfig.newBuilder().build(); + * int ackDeadlineSeconds = 2135351438; + * Subscription response = + * subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); + * } + * }+ * + * @param name Required. The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a + * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores + * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 + * and 255 characters in length, and it must not start with `"goog"`. + * @param topic Required. The name of the topic from which this subscription is receiving + * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be + * `_deleted-topic_` if the topic has been deleted. + * @param pushConfig If push delivery is used with this subscription, this field is used to + * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack + * messages using API methods. + * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits + * for the subscriber to acknowledge receipt before resending the message. In the interval + * after the message is delivered and before it is acknowledged, it is considered to be + * <i>outstanding</i>. During that time period, the message will not be + * redelivered (on a best-effort basis). + *
For pull subscriptions, this value is used as the initial value for the ack deadline. To + * override this value for a given message, call `ModifyAckDeadline` with the corresponding + * `ack_id` if using non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline + * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds + * (10 minutes). If this parameter is 0, a default value of 10 seconds is used. + *
For push delivery, this value is also used to set the request timeout for the call to + * the push endpoint. + *
If the subscriber never acknowledges the message, the Pub/Sub system will eventually + * redeliver the message. + * @deprecated Use {@link #createSubscription(SubscriptionName, String, PushConfig, int)} instead. + */ + @Deprecated + public final Subscription createSubscription( + ProjectSubscriptionName name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) { + Subscription request = + Subscription.newBuilder() + .setName(name == null ? null : name.toString()) + .setTopic(topic) + .setPushConfig(pushConfig) + .setAckDeadlineSeconds(ackDeadlineSeconds) + .build(); + return createSubscription(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a subscription to a given topic. See the [resource name rules] + * (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already + * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns + * `NOT_FOUND`. + * + *
If the name is not provided in the request, the server will assign a random name for this + * subscription on the same project as the topic, conforming to the [resource name format] + * (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in + * the returned Subscription object. Note that for REST API requests, you must specify a name in + * the request. + * + *
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * ProjectSubscriptionName name = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + * TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); + * PushConfig pushConfig = PushConfig.newBuilder().build(); + * int ackDeadlineSeconds = 2135351438; + * Subscription response = + * subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); + * } + * }+ * + * @param name Required. The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a + * letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores + * (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 + * and 255 characters in length, and it must not start with `"goog"`. + * @param topic Required. The name of the topic from which this subscription is receiving + * messages. Format is `projects/{project}/topics/{topic}`. The value of this field will be + * `_deleted-topic_` if the topic has been deleted. + * @param pushConfig If push delivery is used with this subscription, this field is used to + * configure it. An empty `pushConfig` signifies that the subscriber will pull and ack + * messages using API methods. + * @param ackDeadlineSeconds The approximate amount of time (on a best-effort basis) Pub/Sub waits + * for the subscriber to acknowledge receipt before resending the message. In the interval + * after the message is delivered and before it is acknowledged, it is considered to be + * <i>outstanding</i>. During that time period, the message will not be + * redelivered (on a best-effort basis). + *
For pull subscriptions, this value is used as the initial value for the ack deadline. To + * override this value for a given message, call `ModifyAckDeadline` with the corresponding + * `ack_id` if using non-streaming pull or send the `ack_id` in a + * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum custom deadline + * you can specify is 10 seconds. The maximum custom deadline you can specify is 600 seconds + * (10 minutes). If this parameter is 0, a default value of 10 seconds is used. + *
For push delivery, this value is also used to set the request timeout for the call to + * the push endpoint. + *
If the subscriber never acknowledges the message, the Pub/Sub system will eventually + * redeliver the message. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #createSubscription(SubscriptionName, TopicName, PushConfig, int)} + * instead. + */ + @Deprecated + public final Subscription createSubscription( + ProjectSubscriptionName name, + TopicName topic, + PushConfig pushConfig, + int ackDeadlineSeconds) { + Subscription request = + Subscription.newBuilder() + .setName(name == null ? null : name.toString()) + .setTopic(topic == null ? null : topic.toString()) + .setPushConfig(pushConfig) + .setAckDeadlineSeconds(ackDeadlineSeconds) + .build(); + return createSubscription(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a subscription to a given topic. See the [resource name rules] @@ -688,6 +901,33 @@ public final Subscription getSubscription(GetSubscriptionRequest request) { return getSubscriptionCallable().call(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the configuration details of a subscription. + * + *
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + * Subscription response = subscriptionAdminClient.getSubscription(subscription); + * } + * }+ * + * @param subscription Required. The name of the subscription to get. Format is + * `projects/{project}/subscriptions/{sub}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #getSubscription(SubscriptionName)} instead. + */ + @Deprecated + public final Subscription getSubscription(ProjectSubscriptionName subscription) { + GetSubscriptionRequest request = + GetSubscriptionRequest.newBuilder() + .setSubscription(subscription == null ? null : subscription.toString()) + .build(); + return getSubscription(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets the configuration details of a subscription. @@ -1072,6 +1312,36 @@ public final void deleteSubscription(DeleteSubscriptionRequest request) { deleteSubscriptionCallable().call(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an existing subscription. All messages retained in the subscription are immediately + * dropped. Calls to `Pull` after deletion will return `NOT_FOUND`. After a subscription is + * deleted, a new one may be created with the same name, but the new one has no association with + * the old subscription or its topic unless the same topic is specified. + * + *
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + * subscriptionAdminClient.deleteSubscription(subscription); + * } + * }+ * + * @param subscription Required. The subscription to delete. Format is + * `projects/{project}/subscriptions/{sub}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #deleteSubscription(SubscriptionName)} instead. + */ + @Deprecated + public final void deleteSubscription(ProjectSubscriptionName subscription) { + DeleteSubscriptionRequest request = + DeleteSubscriptionRequest.newBuilder() + .setSubscription(subscription == null ? null : subscription.toString()) + .build(); + deleteSubscription(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes an existing subscription. All messages retained in the subscription are immediately @@ -1228,6 +1498,49 @@ public final void modifyAckDeadline(ModifyAckDeadlineRequest request) { modifyAckDeadlineCallable().call(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Modifies the ack deadline for a specific message. This method is useful to indicate that more + * time is needed to process a message by the subscriber, or to make the message available for + * redelivery if the processing was interrupted. Note that this does not modify the + * subscription-level `ackDeadlineSeconds` used for subsequent messages. + * + *
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + * List+ * + * @param subscription Required. The name of the subscription. Format is + * `projects/{project}/subscriptions/{sub}`. + * @param ackIds Required. List of acknowledgment IDs. + * @param ackDeadlineSeconds Required. The new ack deadline with respect to the time this request + * was sent to the Pub/Sub system. For example, if the value is 10, the new ack deadline will + * expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying zero might + * immediately make the message available for delivery to another subscriber client. This + * typically results in an increase in the rate of message redeliveries (that is, duplicates). + * The minimum deadline you can specify is 0 seconds. The maximum deadline you can specify is + * 600 seconds (10 minutes). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #modifyAckDeadline(SubscriptionName, ListackIds = new ArrayList<>(); + * int ackDeadlineSeconds = 2135351438; + * subscriptionAdminClient.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds); + * } + * }
Acknowledging a message whose ack deadline has expired may succeed, but such a message may + * be redelivered later. Acknowledging a message more than once will not result in an error. + * + *
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + * List+ * + * @param subscription Required. The subscription whose message is being acknowledged. Format is + * `projects/{project}/subscriptions/{sub}`. + * @param ackIds Required. The acknowledgment ID for the messages being acknowledged that was + * returned by the Pub/Sub system in the `Pull` response. Must not be empty. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #acknowledge(SubscriptionName, ListackIds = new ArrayList<>(); + * subscriptionAdminClient.acknowledge(subscription, ackIds); + * } + * }
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + * int maxMessages = 496131527; + * PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages); + * } + * }+ * + * @param subscription Required. The subscription from which messages should be pulled. Format is + * `projects/{project}/subscriptions/{sub}`. + * @param maxMessages Required. The maximum number of messages to return for this request. Must be + * a positive integer. The Pub/Sub system may return fewer than the number specified. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #pull(SubscriptionName, int)} instead. + */ + @Deprecated + public final PullResponse pull(ProjectSubscriptionName subscription, int maxMessages) { + PullRequest request = + PullRequest.newBuilder() + .setSubscription(subscription == null ? null : subscription.toString()) + .setMaxMessages(maxMessages) + .build(); + return pull(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Pulls messages from the server. The server may return `UNAVAILABLE` if there are too many + * concurrent pull requests pending for the given subscription. + * + *
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + * boolean returnImmediately = true; + * int maxMessages = 496131527; + * PullResponse response = + * subscriptionAdminClient.pull(subscription, returnImmediately, maxMessages); + * } + * }+ * + * @param subscription Required. The subscription from which messages should be pulled. Format is + * `projects/{project}/subscriptions/{sub}`. + * @param returnImmediately Optional. If this field set to true, the system will respond + * immediately even if it there are no messages available to return in the `Pull` response. + * Otherwise, the system may wait (for a bounded amount of time) until at least one message is + * available, rather than returning no messages. Warning: setting this field to `true` is + * discouraged because it adversely impacts the performance of `Pull` operations. We recommend + * that users do not set this field. + * @param maxMessages Required. The maximum number of messages to return for this request. Must be + * a positive integer. The Pub/Sub system may return fewer than the number specified. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #pull(SubscriptionName, boolean, int)} instead. + */ + @Deprecated + final PullResponse pull( + ProjectSubscriptionName subscription, boolean returnImmediately, int maxMessages) { + PullRequest request = + PullRequest.newBuilder() + .setSubscription(subscription == null ? null : subscription.toString()) + .setReturnImmediately(returnImmediately) + .setMaxMessages(maxMessages) + .build(); + return pull(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. @@ -1769,6 +2191,44 @@ public final void modifyPushConfig(ModifyPushConfigRequest request) { modifyPushConfigCallable().call(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Modifies the `PushConfig` for a specified subscription. + * + *
This may be used to change a push subscription to a pull one (signified by an empty + * `PushConfig`) or vice versa, or change the endpoint URL and other attributes of a push + * subscription. Messages will accumulate for delivery continuously through the call regardless of + * changes to the `PushConfig`. + * + *
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + * PushConfig pushConfig = PushConfig.newBuilder().build(); + * subscriptionAdminClient.modifyPushConfig(subscription, pushConfig); + * } + * }+ * + * @param subscription Required. The name of the subscription. Format is + * `projects/{project}/subscriptions/{sub}`. + * @param pushConfig Required. The push configuration for future deliveries. + *
An empty `pushConfig` indicates that the Pub/Sub system should stop pushing messages + * from the given subscription and allow messages to be pulled and acknowledged - effectively + * pausing the subscription if `Pull` or `StreamingPull` is not called. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use {@link #modifyPushConfig(SubscriptionName, PushConfig)} instead. + */ + @Deprecated + public final void modifyPushConfig(ProjectSubscriptionName subscription, PushConfig pushConfig) { + ModifyPushConfigRequest request = + ModifyPushConfigRequest.newBuilder() + .setSubscription(subscription == null ? null : subscription.toString()) + .setPushConfig(pushConfig) + .build(); + modifyPushConfig(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Modifies the `PushConfig` for a specified subscription. @@ -1897,6 +2357,36 @@ public final Snapshot getSnapshot(GetSnapshotRequest request) { return getSnapshotCallable().call(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the configuration details of a snapshot. Snapshots are used in <a + * href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> operations, which + * allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment + * state of messages in an existing subscription to the state captured by a snapshot. + * + *
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + * Snapshot response = subscriptionAdminClient.getSnapshot(snapshot); + * } + * }+ * + * @param snapshot Required. The name of the snapshot to get. Format is + * `projects/{project}/snapshots/{snap}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use Use {@link #getSnapshot(SnapshotName)} instead. + */ + @Deprecated + public final Snapshot getSnapshot(ProjectSnapshotName snapshot) { + GetSnapshotRequest request = + GetSnapshotRequest.newBuilder() + .setSnapshot(snapshot == null ? null : snapshot.toString()) + .build(); + return getSnapshot(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets the configuration details of a snapshot. Snapshots are used in @@ -2358,6 +2848,157 @@ public final Snapshot createSnapshot(CreateSnapshotRequest request) { return createSnapshotCallable().call(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a snapshot from the requested subscription. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to + * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of + * messages in an existing subscription to the state captured by a snapshot. If the snapshot + * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns + * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would + * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the + * `Snapshot.expire_time` field. If the name is not provided in the request, the server will + * assign a random name for this snapshot on the same project as the subscription, conforming to + * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The + * generated name is populated in the returned Snapshot object. Note that for REST API requests, + * you must specify a name in the request. + * + *
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + * Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription); + * } + * }+ * + * @param name Required. User-provided name for this snapshot. If the name is not provided in the + * request, the server will assign a random name for this snapshot on the same project as the + * subscription. Note that for REST API requests, you must specify a name. See the <a + * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name + * rules</a>. Format is `projects/{project}/snapshots/{snap}`. + * @param subscription Required. The subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the + * subscription. More precisely, this is defined as the messages in the subscription's backlog + * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as + * well as: (b) Any messages published to the subscription's topic following the successful + * completion of the CreateSnapshot request. Format is + * `projects/{project}/subscriptions/{sub}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use Use {@link #createSnapshot(SnapshotName, SubscriptionName)} instead. + */ + @Deprecated + public final Snapshot createSnapshot( + ProjectSnapshotName name, ProjectSubscriptionName subscription) { + CreateSnapshotRequest request = + CreateSnapshotRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setSubscription(subscription == null ? null : subscription.toString()) + .build(); + return createSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a snapshot from the requested subscription. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to + * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of + * messages in an existing subscription to the state captured by a snapshot. If the snapshot + * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns + * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would + * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the + * `Snapshot.expire_time` field. If the name is not provided in the request, the server will + * assign a random name for this snapshot on the same project as the subscription, conforming to + * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The + * generated name is populated in the returned Snapshot object. Note that for REST API requests, + * you must specify a name in the request. + * + *
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * String name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString(); + * ProjectSubscriptionName subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + * Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription); + * } + * }+ * + * @param name Required. User-provided name for this snapshot. If the name is not provided in the + * request, the server will assign a random name for this snapshot on the same project as the + * subscription. Note that for REST API requests, you must specify a name. See the <a + * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name + * rules</a>. Format is `projects/{project}/snapshots/{snap}`. + * @param subscription Required. The subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the + * subscription. More precisely, this is defined as the messages in the subscription's backlog + * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as + * well as: (b) Any messages published to the subscription's topic following the successful + * completion of the CreateSnapshot request. Format is + * `projects/{project}/subscriptions/{sub}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use Use {@link #createSnapshot(String, SubscriptionName)} instead. + */ + @Deprecated + public final Snapshot createSnapshot(String name, ProjectSubscriptionName subscription) { + CreateSnapshotRequest request = + CreateSnapshotRequest.newBuilder() + .setName(name) + .setSubscription(subscription == null ? null : subscription.toString()) + .build(); + return createSnapshot(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a snapshot from the requested subscription. Snapshots are used in + * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to + * manage message acknowledgments in bulk. That is, you can set the acknowledgment state of + * messages in an existing subscription to the state captured by a snapshot. If the snapshot + * already exists, returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, returns + * `NOT_FOUND`. If the backlog in the subscription is too old -- and the resulting snapshot would + * expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. See also the + * `Snapshot.expire_time` field. If the name is not provided in the request, the server will + * assign a random name for this snapshot on the same project as the subscription, conforming to + * the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The + * generated name is populated in the returned Snapshot object. Note that for REST API requests, + * you must specify a name in the request. + * + *
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * ProjectSnapshotName name = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + * String subscription = ProjectSubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString(); + * Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription); + * } + * }+ * + * @param name Required. User-provided name for this snapshot. If the name is not provided in the + * request, the server will assign a random name for this snapshot on the same project as the + * subscription. Note that for REST API requests, you must specify a name. See the <a + * href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name + * rules</a>. Format is `projects/{project}/snapshots/{snap}`. + * @param subscription Required. The subscription whose backlog the snapshot retains. + * Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the + * subscription. More precisely, this is defined as the messages in the subscription's backlog + * that are unacknowledged upon the successful completion of the `CreateSnapshot` request; as + * well as: (b) Any messages published to the subscription's topic following the successful + * completion of the CreateSnapshot request. Format is + * `projects/{project}/subscriptions/{sub}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use Use {@link #createSnapshot(SnapshotName, String)} instead. + */ + @Deprecated + public final Snapshot createSnapshot(ProjectSnapshotName name, String subscription) { + CreateSnapshotRequest request = + CreateSnapshotRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setSubscription(subscription) + .build(); + return createSnapshot(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a snapshot from the requested subscription. Snapshots are used in @@ -2600,6 +3241,39 @@ public final void deleteSnapshot(DeleteSnapshotRequest request) { deleteSnapshotCallable().call(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes an existing snapshot. Snapshots are used in [Seek] + * (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage + * message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in + * an existing subscription to the state captured by a snapshot. When the snapshot is deleted, all + * messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new + * one may be created with the same name, but the new one has no association with the old snapshot + * or its subscription, unless the same subscription is specified. + * + *
Sample code: + * + *
{@code + * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + * ProjectSnapshotName snapshot = ProjectSnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + * subscriptionAdminClient.deleteSnapshot(snapshot); + * } + * }+ * + * @param snapshot Required. The name of the snapshot to delete. Format is + * `projects/{project}/snapshots/{snap}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + * @deprecated Use Use {@link #deleteSnapshot(SnapshotName)} instead. + */ + @Deprecated + public final void deleteSnapshot(ProjectSnapshotName snapshot) { + DeleteSnapshotRequest request = + DeleteSnapshotRequest.newBuilder() + .setSnapshot(snapshot == null ? null : snapshot.toString()) + .build(); + deleteSnapshot(request); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Removes an existing snapshot. Snapshots are used in [Seek] @@ -2731,6 +3405,37 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { return setIamPolicyCallable().call(request); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *
Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *
Sample code: + * + *
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+ * Policy policy = Policy.newBuilder().build();
+ * Policy response = subscriptionAdminClient.setIamPolicy(formattedResource, policy);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy is being specified. See the
+ * operation documentation for the appropriate value for this field.
+ * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the
+ * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud
+ * Platform services (such as Projects) might reject them.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead.
+ */
+ @Deprecated
+ public final Policy setIamPolicy(String resource, Policy policy) {
+ SetIamPolicyRequest request =
+ SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build();
+ return setIamPolicy(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Sets the access control policy on the specified resource. Replacesany existing policy.
@@ -2792,6 +3497,31 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
return getIamPolicyCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets the access control policy for a resource. Returns an empty policy if the resource exists
+ * and does not have a policy set.
+ *
+ * Sample code: + * + *
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+ * Policy response = subscriptionAdminClient.getIamPolicy(formattedResource);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy is being requested. See the
+ * operation documentation for the appropriate value for this field.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead.
+ */
+ @Deprecated
+ public final Policy getIamPolicy(String resource) {
+ GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build();
+ return getIamPolicy(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the access control policy for a resource. Returns an empty policyif the resource exists
@@ -2855,6 +3585,44 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
return testIamPermissionsCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns permissions that a caller has on the specified resource. If the resource does not
+ * exist, this will return an empty set of permissions, not a NOT_FOUND error.
+ *
+ * Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *
Sample code: + * + *
+ * try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
+ * String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+ * List<String> permissions = new ArrayList<>();
+ * TestIamPermissionsResponse response = subscriptionAdminClient.testIamPermissions(formattedResource, permissions);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy detail is being requested. See the
+ * operation documentation for the appropriate value for this field.
+ * @param permissions The set of permissions to check for the `resource`. Permissions with
+ * wildcards (such as '*' or 'storage.*') are not allowed. For more information see
+ * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead.
+ */
+ @Deprecated
+ public final TestIamPermissionsResponse testIamPermissions(
+ String resource, ListSample code: + * + *
+ * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+ * ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+ * Topic response = topicAdminClient.createTopic(name);
+ * }
+ *
+ *
+ * @param name Required. The name of the topic. It must have the format
+ * `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only
+ * letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`),
+ * tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in
+ * length, and it must not start with `"goog"`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #createTopic(TopicName)} instead.
+ */
+ @Deprecated
+ public final Topic createTopic(ProjectTopicName name) {
+ Topic request = Topic.newBuilder().setName(name == null ? null : name.toString()).build();
+ return createTopic(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates the given topic with the given name. See the [resource name rules]
@@ -588,6 +618,31 @@ public final Topic getTopic(String topic) {
return getTopic(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets the configuration of a topic.
+ *
+ * Sample code: + * + *
+ * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+ * ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+ * Topic response = topicAdminClient.getTopic(topic);
+ * }
+ *
+ *
+ * @param topic Required. The name of the topic to get. Format is
+ * `projects/{project}/topics/{topic}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #getTopic(TopicName)} instead.
+ */
+ @Deprecated
+ public final Topic getTopic(ProjectTopicName topic) {
+ GetTopicRequest request =
+ GetTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build();
+ return getTopic(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the configuration of a topic.
@@ -867,6 +922,35 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(String t
return listTopicSubscriptions(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Lists the names of the subscriptions on this topic.
+ *
+ * Sample code: + * + *
+ * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+ * ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+ * for (ProjectSubscriptionName element : topicAdminClient.listTopicSubscriptions(topic).iterateAllAsProjectSubscriptionName()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ *
+ *
+ * @param topic Required. The name of the topic that subscriptions are attached to. Format is
+ * `projects/{project}/topics/{topic}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #listTopicSubscriptions(TopicName)} instead.
+ */
+ @Deprecated
+ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(ProjectTopicName topic) {
+ ListTopicSubscriptionsRequest request =
+ ListTopicSubscriptionsRequest.newBuilder()
+ .setTopic(topic == null ? null : topic.toString())
+ .build();
+ return listTopicSubscriptions(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists the names of the attached subscriptions on this topic.
@@ -1217,6 +1301,34 @@ public final void deleteTopic(String topic) {
deleteTopic(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a
+ * topic is deleted, a new topic may be created with the same name; this is an entirely new topic
+ * with none of the old configuration or subscriptions. Existing subscriptions to this topic are
+ * not deleted, but their `topic` field is set to `_deleted-topic_`.
+ *
+ * Sample code: + * + *
+ * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+ * ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
+ * topicAdminClient.deleteTopic(topic);
+ * }
+ *
+ *
+ * @param topic Required. Name of the topic to delete. Format is
+ * `projects/{project}/topics/{topic}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #deleteTopic(TopicName)} instead.
+ */
+ @Deprecated
+ public final void deleteTopic(ProjectTopicName topic) {
+ DeleteTopicRequest request =
+ DeleteTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build();
+ deleteTopic(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a
@@ -1371,6 +1483,37 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
return setIamPolicyCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Sets the access control policy on the specified resource. Replaces any existing policy.
+ *
+ * Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED + * + *
Sample code: + * + *
+ * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+ * String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+ * Policy policy = Policy.newBuilder().build();
+ * Policy response = topicAdminClient.setIamPolicy(formattedResource, policy);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy is being specified. See the
+ * operation documentation for the appropriate value for this field.
+ * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the
+ * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud
+ * Platform services (such as Projects) might reject them.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead.
+ */
+ @Deprecated
+ public final Policy setIamPolicy(String resource, Policy policy) {
+ SetIamPolicyRequest request =
+ SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build();
+ return setIamPolicy(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Sets the access control policy on the specified resource. Replacesany existing policy.
@@ -1432,6 +1575,31 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
return getIamPolicyCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Gets the access control policy for a resource. Returns an empty policy if the resource exists
+ * and does not have a policy set.
+ *
+ * Sample code: + * + *
+ * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+ * String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+ * Policy response = topicAdminClient.getIamPolicy(formattedResource);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy is being requested. See the
+ * operation documentation for the appropriate value for this field.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead.
+ */
+ @Deprecated
+ public final Policy getIamPolicy(String resource) {
+ GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build();
+ return getIamPolicy(request);
+ }
+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets the access control policy for a resource. Returns an empty policyif the resource exists
@@ -1495,6 +1663,44 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
return testIamPermissionsCallable().call(request);
}
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
+ /**
+ * Returns permissions that a caller has on the specified resource. If the resource does not
+ * exist, this will return an empty set of permissions, not a NOT_FOUND error.
+ *
+ * Note: This operation is designed to be used for building permission-aware UIs and + * command-line tools, not for authorization checking. This operation may "fail open" without + * warning. + * + *
Sample code: + * + *
+ * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
+ * String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
+ * List<String> permissions = new ArrayList<>();
+ * TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(formattedResource, permissions);
+ * }
+ *
+ *
+ * @param resource REQUIRED: The resource for which the policy detail is being requested. See the
+ * operation documentation for the appropriate value for this field.
+ * @param permissions The set of permissions to check for the `resource`. Permissions with
+ * wildcards (such as '*' or 'storage.*') are not allowed. For more information see
+ * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ * @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead.
+ */
+ @Deprecated
+ public final TestIamPermissionsResponse testIamPermissions(
+ String resource, List* The service that an application uses to manipulate topics, and to send * messages to a topic. @@ -19,330 +36,423 @@ private PublisherGrpc() {} public static final java.lang.String SERVICE_NAME = "google.pubsub.v1.Publisher"; // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptorgetCreateTopicMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.Topic, com.google.pubsub.v1.Topic> + getCreateTopicMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "CreateTopic", requestType = com.google.pubsub.v1.Topic.class, responseType = com.google.pubsub.v1.Topic.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCreateTopicMethod() { - io.grpc.MethodDescriptor getCreateTopicMethod; + public static io.grpc.MethodDescriptor + getCreateTopicMethod() { + io.grpc.MethodDescriptor + getCreateTopicMethod; if ((getCreateTopicMethod = PublisherGrpc.getCreateTopicMethod) == null) { synchronized (PublisherGrpc.class) { if ((getCreateTopicMethod = PublisherGrpc.getCreateTopicMethod) == null) { - PublisherGrpc.getCreateTopicMethod = getCreateTopicMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateTopic")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Topic.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Topic.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("CreateTopic")) - .build(); + PublisherGrpc.getCreateTopicMethod = + getCreateTopicMethod = + io.grpc.MethodDescriptor + . newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateTopic")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Topic.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Topic.getDefaultInstance())) + .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("CreateTopic")) + .build(); } } } return getCreateTopicMethod; } - private static volatile io.grpc.MethodDescriptor getUpdateTopicMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.UpdateTopicRequest, com.google.pubsub.v1.Topic> + getUpdateTopicMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "UpdateTopic", requestType = com.google.pubsub.v1.UpdateTopicRequest.class, responseType = com.google.pubsub.v1.Topic.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getUpdateTopicMethod() { - io.grpc.MethodDescriptor getUpdateTopicMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.UpdateTopicRequest, com.google.pubsub.v1.Topic> + getUpdateTopicMethod() { + io.grpc.MethodDescriptor + getUpdateTopicMethod; if ((getUpdateTopicMethod = PublisherGrpc.getUpdateTopicMethod) == null) { synchronized (PublisherGrpc.class) { if ((getUpdateTopicMethod = PublisherGrpc.getUpdateTopicMethod) == null) { - PublisherGrpc.getUpdateTopicMethod = getUpdateTopicMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateTopic")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.UpdateTopicRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Topic.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("UpdateTopic")) - .build(); + PublisherGrpc.getUpdateTopicMethod = + getUpdateTopicMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateTopic")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.UpdateTopicRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Topic.getDefaultInstance())) + .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("UpdateTopic")) + .build(); } } } return getUpdateTopicMethod; } - private static volatile io.grpc.MethodDescriptor getPublishMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.PublishRequest, com.google.pubsub.v1.PublishResponse> + getPublishMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "Publish", requestType = com.google.pubsub.v1.PublishRequest.class, responseType = com.google.pubsub.v1.PublishResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPublishMethod() { - io.grpc.MethodDescriptor getPublishMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.PublishRequest, com.google.pubsub.v1.PublishResponse> + getPublishMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.PublishRequest, com.google.pubsub.v1.PublishResponse> + getPublishMethod; if ((getPublishMethod = PublisherGrpc.getPublishMethod) == null) { synchronized (PublisherGrpc.class) { if ((getPublishMethod = PublisherGrpc.getPublishMethod) == null) { - PublisherGrpc.getPublishMethod = getPublishMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Publish")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.PublishRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.PublishResponse.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("Publish")) - .build(); + PublisherGrpc.getPublishMethod = + getPublishMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Publish")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.PublishRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.PublishResponse.getDefaultInstance())) + .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("Publish")) + .build(); } } } return getPublishMethod; } - private static volatile io.grpc.MethodDescriptor getGetTopicMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.GetTopicRequest, com.google.pubsub.v1.Topic> + getGetTopicMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "GetTopic", requestType = com.google.pubsub.v1.GetTopicRequest.class, responseType = com.google.pubsub.v1.Topic.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetTopicMethod() { - io.grpc.MethodDescriptor getGetTopicMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.GetTopicRequest, com.google.pubsub.v1.Topic> + getGetTopicMethod() { + io.grpc.MethodDescriptor + getGetTopicMethod; if ((getGetTopicMethod = PublisherGrpc.getGetTopicMethod) == null) { synchronized (PublisherGrpc.class) { if ((getGetTopicMethod = PublisherGrpc.getGetTopicMethod) == null) { - PublisherGrpc.getGetTopicMethod = getGetTopicMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetTopic")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.GetTopicRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Topic.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("GetTopic")) - .build(); + PublisherGrpc.getGetTopicMethod = + getGetTopicMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetTopic")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.GetTopicRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Topic.getDefaultInstance())) + .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("GetTopic")) + .build(); } } } return getGetTopicMethod; } - private static volatile io.grpc.MethodDescriptor getListTopicsMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListTopicsRequest, com.google.pubsub.v1.ListTopicsResponse> + getListTopicsMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "ListTopics", requestType = com.google.pubsub.v1.ListTopicsRequest.class, responseType = com.google.pubsub.v1.ListTopicsResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListTopicsMethod() { - io.grpc.MethodDescriptor getListTopicsMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListTopicsRequest, com.google.pubsub.v1.ListTopicsResponse> + getListTopicsMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListTopicsRequest, com.google.pubsub.v1.ListTopicsResponse> + getListTopicsMethod; if ((getListTopicsMethod = PublisherGrpc.getListTopicsMethod) == null) { synchronized (PublisherGrpc.class) { if ((getListTopicsMethod = PublisherGrpc.getListTopicsMethod) == null) { - PublisherGrpc.getListTopicsMethod = getListTopicsMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTopics")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListTopicsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListTopicsResponse.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("ListTopics")) - .build(); + PublisherGrpc.getListTopicsMethod = + getListTopicsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTopics")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListTopicsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListTopicsResponse.getDefaultInstance())) + .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("ListTopics")) + .build(); } } } return getListTopicsMethod; } - private static volatile io.grpc.MethodDescriptor getListTopicSubscriptionsMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListTopicSubscriptionsRequest, + com.google.pubsub.v1.ListTopicSubscriptionsResponse> + getListTopicSubscriptionsMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "ListTopicSubscriptions", requestType = com.google.pubsub.v1.ListTopicSubscriptionsRequest.class, responseType = com.google.pubsub.v1.ListTopicSubscriptionsResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListTopicSubscriptionsMethod() { - io.grpc.MethodDescriptor getListTopicSubscriptionsMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListTopicSubscriptionsRequest, + com.google.pubsub.v1.ListTopicSubscriptionsResponse> + getListTopicSubscriptionsMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListTopicSubscriptionsRequest, + com.google.pubsub.v1.ListTopicSubscriptionsResponse> + getListTopicSubscriptionsMethod; if ((getListTopicSubscriptionsMethod = PublisherGrpc.getListTopicSubscriptionsMethod) == null) { synchronized (PublisherGrpc.class) { - if ((getListTopicSubscriptionsMethod = PublisherGrpc.getListTopicSubscriptionsMethod) == null) { - PublisherGrpc.getListTopicSubscriptionsMethod = getListTopicSubscriptionsMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTopicSubscriptions")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListTopicSubscriptionsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListTopicSubscriptionsResponse.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("ListTopicSubscriptions")) - .build(); + if ((getListTopicSubscriptionsMethod = PublisherGrpc.getListTopicSubscriptionsMethod) + == null) { + PublisherGrpc.getListTopicSubscriptionsMethod = + getListTopicSubscriptionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListTopicSubscriptions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListTopicSubscriptionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListTopicSubscriptionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new PublisherMethodDescriptorSupplier("ListTopicSubscriptions")) + .build(); } } } return getListTopicSubscriptionsMethod; } - private static volatile io.grpc.MethodDescriptor getListTopicSnapshotsMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListTopicSnapshotsRequest, + com.google.pubsub.v1.ListTopicSnapshotsResponse> + getListTopicSnapshotsMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "ListTopicSnapshots", requestType = com.google.pubsub.v1.ListTopicSnapshotsRequest.class, responseType = com.google.pubsub.v1.ListTopicSnapshotsResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListTopicSnapshotsMethod() { - io.grpc.MethodDescriptor getListTopicSnapshotsMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListTopicSnapshotsRequest, + com.google.pubsub.v1.ListTopicSnapshotsResponse> + getListTopicSnapshotsMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListTopicSnapshotsRequest, + com.google.pubsub.v1.ListTopicSnapshotsResponse> + getListTopicSnapshotsMethod; if ((getListTopicSnapshotsMethod = PublisherGrpc.getListTopicSnapshotsMethod) == null) { synchronized (PublisherGrpc.class) { if ((getListTopicSnapshotsMethod = PublisherGrpc.getListTopicSnapshotsMethod) == null) { - PublisherGrpc.getListTopicSnapshotsMethod = getListTopicSnapshotsMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTopicSnapshots")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListTopicSnapshotsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListTopicSnapshotsResponse.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("ListTopicSnapshots")) - .build(); + PublisherGrpc.getListTopicSnapshotsMethod = + getListTopicSnapshotsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTopicSnapshots")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListTopicSnapshotsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListTopicSnapshotsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new PublisherMethodDescriptorSupplier("ListTopicSnapshots")) + .build(); } } } return getListTopicSnapshotsMethod; } - private static volatile io.grpc.MethodDescriptor getDeleteTopicMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.DeleteTopicRequest, com.google.protobuf.Empty> + getDeleteTopicMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "DeleteTopic", requestType = com.google.pubsub.v1.DeleteTopicRequest.class, responseType = com.google.protobuf.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDeleteTopicMethod() { - io.grpc.MethodDescriptor getDeleteTopicMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.DeleteTopicRequest, com.google.protobuf.Empty> + getDeleteTopicMethod() { + io.grpc.MethodDescriptor + getDeleteTopicMethod; if ((getDeleteTopicMethod = PublisherGrpc.getDeleteTopicMethod) == null) { synchronized (PublisherGrpc.class) { if ((getDeleteTopicMethod = PublisherGrpc.getDeleteTopicMethod) == null) { - PublisherGrpc.getDeleteTopicMethod = getDeleteTopicMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteTopic")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.DeleteTopicRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("DeleteTopic")) - .build(); + PublisherGrpc.getDeleteTopicMethod = + getDeleteTopicMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteTopic")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.DeleteTopicRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("DeleteTopic")) + .build(); } } } return getDeleteTopicMethod; } - private static volatile io.grpc.MethodDescriptor getDetachSubscriptionMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.DetachSubscriptionRequest, + com.google.pubsub.v1.DetachSubscriptionResponse> + getDetachSubscriptionMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "DetachSubscription", requestType = com.google.pubsub.v1.DetachSubscriptionRequest.class, responseType = com.google.pubsub.v1.DetachSubscriptionResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDetachSubscriptionMethod() { - io.grpc.MethodDescriptor getDetachSubscriptionMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.DetachSubscriptionRequest, + com.google.pubsub.v1.DetachSubscriptionResponse> + getDetachSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.DetachSubscriptionRequest, + com.google.pubsub.v1.DetachSubscriptionResponse> + getDetachSubscriptionMethod; if ((getDetachSubscriptionMethod = PublisherGrpc.getDetachSubscriptionMethod) == null) { synchronized (PublisherGrpc.class) { if ((getDetachSubscriptionMethod = PublisherGrpc.getDetachSubscriptionMethod) == null) { - PublisherGrpc.getDetachSubscriptionMethod = getDetachSubscriptionMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DetachSubscription")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.DetachSubscriptionRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.DetachSubscriptionResponse.getDefaultInstance())) - .setSchemaDescriptor(new PublisherMethodDescriptorSupplier("DetachSubscription")) - .build(); + PublisherGrpc.getDetachSubscriptionMethod = + getDetachSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DetachSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.DetachSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.DetachSubscriptionResponse.getDefaultInstance())) + .setSchemaDescriptor( + new PublisherMethodDescriptorSupplier("DetachSubscription")) + .build(); } } } return getDetachSubscriptionMethod; } - /** - * Creates a new async stub that supports all call types for the service - */ + /** Creates a new async stub that supports all call types for the service */ public static PublisherStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory () { - @java.lang.Override - public PublisherStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PublisherStub(channel, callOptions); - } - }; + new io.grpc.stub.AbstractStub.StubFactory () { + @java.lang.Override + public PublisherStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PublisherStub(channel, callOptions); + } + }; return PublisherStub.newStub(factory, channel); } /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ - public static PublisherBlockingStub newBlockingStub( - io.grpc.Channel channel) { + public static PublisherBlockingStub newBlockingStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory () { - @java.lang.Override - public PublisherBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PublisherBlockingStub(channel, callOptions); - } - }; + new io.grpc.stub.AbstractStub.StubFactory () { + @java.lang.Override + public PublisherBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PublisherBlockingStub(channel, callOptions); + } + }; return PublisherBlockingStub.newStub(factory, channel); } - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static PublisherFutureStub newFutureStub( - io.grpc.Channel channel) { + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static PublisherFutureStub newFutureStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory () { - @java.lang.Override - public PublisherFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new PublisherFutureStub(channel, callOptions); - } - }; + new io.grpc.stub.AbstractStub.StubFactory () { + @java.lang.Override + public PublisherFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new PublisherFutureStub(channel, callOptions); + } + }; return PublisherFutureStub.newStub(factory, channel); } /** + * + * * * The service that an application uses to manipulate topics, and to send * messages to a topic. @@ -351,69 +461,93 @@ public PublisherFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions public interface AsyncService { /** + * + * ** Creates the given topic with the given name. See the [resource name rules] * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). **/ - default void createTopic(com.google.pubsub.v1.Topic request, + default void createTopic( + com.google.pubsub.v1.Topic request, io.grpc.stub.StreamObserverresponseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateTopicMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateTopicMethod(), responseObserver); } /** + * + * * * Updates an existing topic. Note that certain properties of a * topic are not modifiable. **/ - default void updateTopic(com.google.pubsub.v1.UpdateTopicRequest request, + default void updateTopic( + com.google.pubsub.v1.UpdateTopicRequest request, io.grpc.stub.StreamObserverresponseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateTopicMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateTopicMethod(), responseObserver); } /** + * + * * * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic * does not exist. **/ - default void publish(com.google.pubsub.v1.PublishRequest request, + default void publish( + com.google.pubsub.v1.PublishRequest request, io.grpc.stub.StreamObserverresponseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPublishMethod(), responseObserver); } /** + * + * * * Gets the configuration of a topic. **/ - default void getTopic(com.google.pubsub.v1.GetTopicRequest request, + default void getTopic( + com.google.pubsub.v1.GetTopicRequest request, io.grpc.stub.StreamObserverresponseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTopicMethod(), responseObserver); } /** + * + * * * Lists matching topics. **/ - default void listTopics(com.google.pubsub.v1.ListTopicsRequest request, + default void listTopics( + com.google.pubsub.v1.ListTopicsRequest request, io.grpc.stub.StreamObserverresponseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTopicsMethod(), responseObserver); } /** + * + * * * Lists the names of the attached subscriptions on this topic. **/ - default void listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsRequest request, - io.grpc.stub.StreamObserverresponseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTopicSubscriptionsMethod(), responseObserver); + default void listTopicSubscriptions( + com.google.pubsub.v1.ListTopicSubscriptionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListTopicSubscriptionsMethod(), responseObserver); } /** + * + * * * Lists the names of the snapshots on this topic. Snapshots are used in * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, @@ -422,12 +556,17 @@ default void listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsR * state captured by a snapshot. **/ - default void listTopicSnapshots(com.google.pubsub.v1.ListTopicSnapshotsRequest request, - io.grpc.stub.StreamObserverresponseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTopicSnapshotsMethod(), responseObserver); + default void listTopicSnapshots( + com.google.pubsub.v1.ListTopicSnapshotsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListTopicSnapshotsMethod(), responseObserver); } /** + * + * * * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic * does not exist. After a topic is deleted, a new topic may be created with @@ -436,12 +575,16 @@ default void listTopicSnapshots(com.google.pubsub.v1.ListTopicSnapshotsRequest r * not deleted, but their `topic` field is set to `_deleted-topic_`. **/ - default void deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request, + default void deleteTopic( + com.google.pubsub.v1.DeleteTopicRequest request, io.grpc.stub.StreamObserverresponseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteTopicMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteTopicMethod(), responseObserver); } /** + * + * * * Detaches a subscription from this topic. All messages retained in the * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests @@ -449,117 +592,146 @@ default void deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request, * subscription, pushes to the endpoint will stop. **/ - default void detachSubscription(com.google.pubsub.v1.DetachSubscriptionRequest request, - io.grpc.stub.StreamObserverresponseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDetachSubscriptionMethod(), responseObserver); + default void detachSubscription( + com.google.pubsub.v1.DetachSubscriptionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDetachSubscriptionMethod(), responseObserver); } } /** * Base class for the server implementation of the service Publisher. + * * * The service that an application uses to manipulate topics, and to send * messages to a topic. **/ - public static abstract class PublisherImplBase - implements io.grpc.BindableService, AsyncService { + public abstract static class PublisherImplBase implements io.grpc.BindableService, AsyncService { - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { return PublisherGrpc.bindService(this); } } /** * A stub to allow clients to do asynchronous rpc calls to service Publisher. + * ** The service that an application uses to manipulate topics, and to send * messages to a topic. **/ - public static final class PublisherStub - extends io.grpc.stub.AbstractAsyncStub{ - private PublisherStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + public static final class PublisherStub extends io.grpc.stub.AbstractAsyncStub { + private PublisherStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override - protected PublisherStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + protected PublisherStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new PublisherStub(channel, callOptions); } /** + * + * * * Creates the given topic with the given name. See the [resource name rules] * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). **/ - public void createTopic(com.google.pubsub.v1.Topic request, + public void createTopic( + com.google.pubsub.v1.Topic request, io.grpc.stub.StreamObserverresponseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateTopicMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getCreateTopicMethod(), getCallOptions()), + request, + responseObserver); } /** + * + * * * Updates an existing topic. Note that certain properties of a * topic are not modifiable. **/ - public void updateTopic(com.google.pubsub.v1.UpdateTopicRequest request, + public void updateTopic( + com.google.pubsub.v1.UpdateTopicRequest request, io.grpc.stub.StreamObserverresponseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateTopicMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getUpdateTopicMethod(), getCallOptions()), + request, + responseObserver); } /** + * + * * * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic * does not exist. **/ - public void publish(com.google.pubsub.v1.PublishRequest request, + public void publish( + com.google.pubsub.v1.PublishRequest request, io.grpc.stub.StreamObserverresponseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getPublishMethod(), getCallOptions()), request, responseObserver); } /** + * + * * * Gets the configuration of a topic. **/ - public void getTopic(com.google.pubsub.v1.GetTopicRequest request, + public void getTopic( + com.google.pubsub.v1.GetTopicRequest request, io.grpc.stub.StreamObserverresponseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetTopicMethod(), getCallOptions()), request, responseObserver); } /** + * + * * * Lists matching topics. **/ - public void listTopics(com.google.pubsub.v1.ListTopicsRequest request, + public void listTopics( + com.google.pubsub.v1.ListTopicsRequest request, io.grpc.stub.StreamObserverresponseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getListTopicsMethod(), getCallOptions()), request, responseObserver); } /** + * + * * * Lists the names of the attached subscriptions on this topic. **/ - public void listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsRequest request, - io.grpc.stub.StreamObserverresponseObserver) { + public void listTopicSubscriptions( + com.google.pubsub.v1.ListTopicSubscriptionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListTopicSubscriptionsMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getListTopicSubscriptionsMethod(), getCallOptions()), + request, + responseObserver); } /** + * + * * * Lists the names of the snapshots on this topic. Snapshots are used in * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, @@ -568,13 +740,19 @@ public void listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsRe * state captured by a snapshot. **/ - public void listTopicSnapshots(com.google.pubsub.v1.ListTopicSnapshotsRequest request, - io.grpc.stub.StreamObserverresponseObserver) { + public void listTopicSnapshots( + com.google.pubsub.v1.ListTopicSnapshotsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListTopicSnapshotsMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getListTopicSnapshotsMethod(), getCallOptions()), + request, + responseObserver); } /** + * + * * * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic * does not exist. After a topic is deleted, a new topic may be created with @@ -583,13 +761,18 @@ public void listTopicSnapshots(com.google.pubsub.v1.ListTopicSnapshotsRequest re * not deleted, but their `topic` field is set to `_deleted-topic_`. **/ - public void deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request, + public void deleteTopic( + com.google.pubsub.v1.DeleteTopicRequest request, io.grpc.stub.StreamObserverresponseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteTopicMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getDeleteTopicMethod(), getCallOptions()), + request, + responseObserver); } /** + * + * * * Detaches a subscription from this topic. All messages retained in the * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests @@ -597,15 +780,20 @@ public void deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request, * subscription, pushes to the endpoint will stop. **/ - public void detachSubscription(com.google.pubsub.v1.DetachSubscriptionRequest request, - io.grpc.stub.StreamObserverresponseObserver) { + public void detachSubscription( + com.google.pubsub.v1.DetachSubscriptionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDetachSubscriptionMethod(), getCallOptions()), request, responseObserver); + getChannel().newCall(getDetachSubscriptionMethod(), getCallOptions()), + request, + responseObserver); } } /** * A stub to allow clients to do synchronous rpc calls to service Publisher. + * * * The service that an application uses to manipulate topics, and to send * messages to a topic. @@ -613,8 +801,7 @@ public void detachSubscription(com.google.pubsub.v1.DetachSubscriptionRequest re */ public static final class PublisherBlockingStub extends io.grpc.stub.AbstractBlockingStub{ - private PublisherBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + private PublisherBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @@ -625,6 +812,8 @@ protected PublisherBlockingStub build( } /** + * + * * * Creates the given topic with the given name. See the [resource name rules] * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). @@ -636,6 +825,8 @@ public com.google.pubsub.v1.Topic createTopic(com.google.pubsub.v1.Topic request } /** + * + * ** Updates an existing topic. Note that certain properties of a * topic are not modifiable. @@ -647,17 +838,22 @@ public com.google.pubsub.v1.Topic updateTopic(com.google.pubsub.v1.UpdateTopicRe } /** + * + * ** Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic * does not exist. **/ - public com.google.pubsub.v1.PublishResponse publish(com.google.pubsub.v1.PublishRequest request) { + public com.google.pubsub.v1.PublishResponse publish( + com.google.pubsub.v1.PublishRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getPublishMethod(), getCallOptions(), request); } /** + * + * ** Gets the configuration of a topic. *@@ -668,26 +864,34 @@ public com.google.pubsub.v1.Topic getTopic(com.google.pubsub.v1.GetTopicRequest } /** + * + * ** Lists matching topics. **/ - public com.google.pubsub.v1.ListTopicsResponse listTopics(com.google.pubsub.v1.ListTopicsRequest request) { + public com.google.pubsub.v1.ListTopicsResponse listTopics( + com.google.pubsub.v1.ListTopicsRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getListTopicsMethod(), getCallOptions(), request); } /** + * + * ** Lists the names of the attached subscriptions on this topic. **/ - public com.google.pubsub.v1.ListTopicSubscriptionsResponse listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsRequest request) { + public com.google.pubsub.v1.ListTopicSubscriptionsResponse listTopicSubscriptions( + com.google.pubsub.v1.ListTopicSubscriptionsRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getListTopicSubscriptionsMethod(), getCallOptions(), request); } /** + * + * ** Lists the names of the snapshots on this topic. Snapshots are used in * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, @@ -696,12 +900,15 @@ public com.google.pubsub.v1.ListTopicSubscriptionsResponse listTopicSubscription * state captured by a snapshot. **/ - public com.google.pubsub.v1.ListTopicSnapshotsResponse listTopicSnapshots(com.google.pubsub.v1.ListTopicSnapshotsRequest request) { + public com.google.pubsub.v1.ListTopicSnapshotsResponse listTopicSnapshots( + com.google.pubsub.v1.ListTopicSnapshotsRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getListTopicSnapshotsMethod(), getCallOptions(), request); } /** + * + * ** Deletes the topic with the given name. Returns `NOT_FOUND` if the topic * does not exist. After a topic is deleted, a new topic may be created with @@ -716,6 +923,8 @@ public com.google.protobuf.Empty deleteTopic(com.google.pubsub.v1.DeleteTopicReq } /** + * + * ** Detaches a subscription from this topic. All messages retained in the * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests @@ -723,7 +932,8 @@ public com.google.protobuf.Empty deleteTopic(com.google.pubsub.v1.DeleteTopicReq * subscription, pushes to the endpoint will stop. **/ - public com.google.pubsub.v1.DetachSubscriptionResponse detachSubscription(com.google.pubsub.v1.DetachSubscriptionRequest request) { + public com.google.pubsub.v1.DetachSubscriptionResponse detachSubscription( + com.google.pubsub.v1.DetachSubscriptionRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getDetachSubscriptionMethod(), getCallOptions(), request); } @@ -731,6 +941,7 @@ public com.google.pubsub.v1.DetachSubscriptionResponse detachSubscription(com.go /** * A stub to allow clients to do ListenableFuture-style rpc calls to service Publisher. + * ** The service that an application uses to manipulate topics, and to send * messages to a topic. @@ -738,54 +949,60 @@ public com.google.pubsub.v1.DetachSubscriptionResponse detachSubscription(com.go */ public static final class PublisherFutureStub extends io.grpc.stub.AbstractFutureStub*/ - public com.google.common.util.concurrent.ListenableFuture{ - private PublisherFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + private PublisherFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override - protected PublisherFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + protected PublisherFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new PublisherFutureStub(channel, callOptions); } /** + * + * * * Creates the given topic with the given name. See the [resource name rules] * (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). **/ - public com.google.common.util.concurrent.ListenableFuturecreateTopic( - com.google.pubsub.v1.Topic request) { + public com.google.common.util.concurrent.ListenableFuture + createTopic(com.google.pubsub.v1.Topic request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getCreateTopicMethod(), getCallOptions()), request); } /** + * + * * * Updates an existing topic. Note that certain properties of a * topic are not modifiable. **/ - public com.google.common.util.concurrent.ListenableFutureupdateTopic( - com.google.pubsub.v1.UpdateTopicRequest request) { + public com.google.common.util.concurrent.ListenableFuture + updateTopic(com.google.pubsub.v1.UpdateTopicRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getUpdateTopicMethod(), getCallOptions()), request); } /** + * + * * * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic * does not exist. **/ - public com.google.common.util.concurrent.ListenableFuturepublish( - com.google.pubsub.v1.PublishRequest request) { + public com.google.common.util.concurrent.ListenableFuture + publish(com.google.pubsub.v1.PublishRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getPublishMethod(), getCallOptions()), request); } /** + * + * * * Gets the configuration of a topic. *@@ -797,28 +1014,36 @@ public com.google.common.util.concurrent.ListenableFuture* Lists matching topics. * listTopics( - com.google.pubsub.v1.ListTopicsRequest request) { + public com.google.common.util.concurrent.ListenableFuture< + com.google.pubsub.v1.ListTopicsResponse> + listTopics(com.google.pubsub.v1.ListTopicsRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getListTopicsMethod(), getCallOptions()), request); } /** + * + * * * Lists the names of the attached subscriptions on this topic. **/ - public com.google.common.util.concurrent.ListenableFuturelistTopicSubscriptions( - com.google.pubsub.v1.ListTopicSubscriptionsRequest request) { + public com.google.common.util.concurrent.ListenableFuture< + com.google.pubsub.v1.ListTopicSubscriptionsResponse> + listTopicSubscriptions(com.google.pubsub.v1.ListTopicSubscriptionsRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getListTopicSubscriptionsMethod(), getCallOptions()), request); } /** + * + * * * Lists the names of the snapshots on this topic. Snapshots are used in * [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, @@ -827,13 +1052,16 @@ public com.google.common.util.concurrent.ListenableFuture*/ - public com.google.common.util.concurrent.ListenableFuture listTopicSnapshots( - com.google.pubsub.v1.ListTopicSnapshotsRequest request) { + public com.google.common.util.concurrent.ListenableFuture< + com.google.pubsub.v1.ListTopicSnapshotsResponse> + listTopicSnapshots(com.google.pubsub.v1.ListTopicSnapshotsRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getListTopicSnapshotsMethod(), getCallOptions()), request); } /** + * + * * * Deletes the topic with the given name. Returns `NOT_FOUND` if the topic * does not exist. After a topic is deleted, a new topic may be created with @@ -842,13 +1070,15 @@ public com.google.common.util.concurrent.ListenableFuture*/ - public com.google.common.util.concurrent.ListenableFuture deleteTopic( - com.google.pubsub.v1.DeleteTopicRequest request) { + public com.google.common.util.concurrent.ListenableFuture + deleteTopic(com.google.pubsub.v1.DeleteTopicRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getDeleteTopicMethod(), getCallOptions()), request); } /** + * + * * * Detaches a subscription from this topic. All messages retained in the * subscription are dropped. Subsequent `Pull` and `StreamingPull` requests @@ -856,8 +1086,9 @@ public com.google.common.util.concurrent.ListenableFuture*/ - public com.google.common.util.concurrent.ListenableFuture detachSubscription( - com.google.pubsub.v1.DetachSubscriptionRequest request) { + public com.google.common.util.concurrent.ListenableFuture< + com.google.pubsub.v1.DetachSubscriptionResponse> + detachSubscription(com.google.pubsub.v1.DetachSubscriptionRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getDetachSubscriptionMethod(), getCallOptions()), request); } @@ -873,11 +1104,11 @@ public com.google.common.util.concurrent.ListenableFuture implements - io.grpc.stub.ServerCalls.UnaryMethod , - io.grpc.stub.ServerCalls.ServerStreamingMethod , - io.grpc.stub.ServerCalls.ClientStreamingMethod , - io.grpc.stub.ServerCalls.BidiStreamingMethod { + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod , + io.grpc.stub.ServerCalls.ServerStreamingMethod , + io.grpc.stub.ServerCalls.ClientStreamingMethod , + io.grpc.stub.ServerCalls.BidiStreamingMethod { private final AsyncService serviceImpl; private final int methodId; @@ -891,40 +1122,53 @@ private static final class MethodHandlers implements public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { case METHODID_CREATE_TOPIC: - serviceImpl.createTopic((com.google.pubsub.v1.Topic) request, + serviceImpl.createTopic( + (com.google.pubsub.v1.Topic) request, (io.grpc.stub.StreamObserver ) responseObserver); break; case METHODID_UPDATE_TOPIC: - serviceImpl.updateTopic((com.google.pubsub.v1.UpdateTopicRequest) request, + serviceImpl.updateTopic( + (com.google.pubsub.v1.UpdateTopicRequest) request, (io.grpc.stub.StreamObserver ) responseObserver); break; case METHODID_PUBLISH: - serviceImpl.publish((com.google.pubsub.v1.PublishRequest) request, + serviceImpl.publish( + (com.google.pubsub.v1.PublishRequest) request, (io.grpc.stub.StreamObserver ) responseObserver); break; case METHODID_GET_TOPIC: - serviceImpl.getTopic((com.google.pubsub.v1.GetTopicRequest) request, + serviceImpl.getTopic( + (com.google.pubsub.v1.GetTopicRequest) request, (io.grpc.stub.StreamObserver ) responseObserver); break; case METHODID_LIST_TOPICS: - serviceImpl.listTopics((com.google.pubsub.v1.ListTopicsRequest) request, - (io.grpc.stub.StreamObserver ) responseObserver); + serviceImpl.listTopics( + (com.google.pubsub.v1.ListTopicsRequest) request, + (io.grpc.stub.StreamObserver ) + responseObserver); break; case METHODID_LIST_TOPIC_SUBSCRIPTIONS: - serviceImpl.listTopicSubscriptions((com.google.pubsub.v1.ListTopicSubscriptionsRequest) request, - (io.grpc.stub.StreamObserver ) responseObserver); + serviceImpl.listTopicSubscriptions( + (com.google.pubsub.v1.ListTopicSubscriptionsRequest) request, + (io.grpc.stub.StreamObserver ) + responseObserver); break; case METHODID_LIST_TOPIC_SNAPSHOTS: - serviceImpl.listTopicSnapshots((com.google.pubsub.v1.ListTopicSnapshotsRequest) request, - (io.grpc.stub.StreamObserver ) responseObserver); + serviceImpl.listTopicSnapshots( + (com.google.pubsub.v1.ListTopicSnapshotsRequest) request, + (io.grpc.stub.StreamObserver ) + responseObserver); break; case METHODID_DELETE_TOPIC: - serviceImpl.deleteTopic((com.google.pubsub.v1.DeleteTopicRequest) request, + serviceImpl.deleteTopic( + (com.google.pubsub.v1.DeleteTopicRequest) request, (io.grpc.stub.StreamObserver ) responseObserver); break; case METHODID_DETACH_SUBSCRIPTION: - serviceImpl.detachSubscription((com.google.pubsub.v1.DetachSubscriptionRequest) request, - (io.grpc.stub.StreamObserver ) responseObserver); + serviceImpl.detachSubscription( + (com.google.pubsub.v1.DetachSubscriptionRequest) request, + (io.grpc.stub.StreamObserver ) + responseObserver); break; default: throw new AssertionError(); @@ -945,73 +1189,67 @@ public io.grpc.stub.StreamObserver invoke( public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( - getCreateTopicMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.Topic, - com.google.pubsub.v1.Topic>( - service, METHODID_CREATE_TOPIC))) + getCreateTopicMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers ( + service, METHODID_CREATE_TOPIC))) .addMethod( - getUpdateTopicMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.UpdateTopicRequest, - com.google.pubsub.v1.Topic>( - service, METHODID_UPDATE_TOPIC))) + getUpdateTopicMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.UpdateTopicRequest, com.google.pubsub.v1.Topic>( + service, METHODID_UPDATE_TOPIC))) .addMethod( - getPublishMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.PublishRequest, - com.google.pubsub.v1.PublishResponse>( - service, METHODID_PUBLISH))) + getPublishMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.PublishRequest, com.google.pubsub.v1.PublishResponse>( + service, METHODID_PUBLISH))) .addMethod( - getGetTopicMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.GetTopicRequest, - com.google.pubsub.v1.Topic>( - service, METHODID_GET_TOPIC))) + getGetTopicMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.GetTopicRequest, com.google.pubsub.v1.Topic>( + service, METHODID_GET_TOPIC))) .addMethod( - getListTopicsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ListTopicsRequest, - com.google.pubsub.v1.ListTopicsResponse>( - service, METHODID_LIST_TOPICS))) + getListTopicsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.ListTopicsRequest, + com.google.pubsub.v1.ListTopicsResponse>(service, METHODID_LIST_TOPICS))) .addMethod( - getListTopicSubscriptionsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ListTopicSubscriptionsRequest, - com.google.pubsub.v1.ListTopicSubscriptionsResponse>( - service, METHODID_LIST_TOPIC_SUBSCRIPTIONS))) + getListTopicSubscriptionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.ListTopicSubscriptionsRequest, + com.google.pubsub.v1.ListTopicSubscriptionsResponse>( + service, METHODID_LIST_TOPIC_SUBSCRIPTIONS))) .addMethod( - getListTopicSnapshotsMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.ListTopicSnapshotsRequest, - com.google.pubsub.v1.ListTopicSnapshotsResponse>( - service, METHODID_LIST_TOPIC_SNAPSHOTS))) + getListTopicSnapshotsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.ListTopicSnapshotsRequest, + com.google.pubsub.v1.ListTopicSnapshotsResponse>( + service, METHODID_LIST_TOPIC_SNAPSHOTS))) .addMethod( - getDeleteTopicMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.DeleteTopicRequest, - com.google.protobuf.Empty>( - service, METHODID_DELETE_TOPIC))) + getDeleteTopicMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.DeleteTopicRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_TOPIC))) .addMethod( - getDetachSubscriptionMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.pubsub.v1.DetachSubscriptionRequest, - com.google.pubsub.v1.DetachSubscriptionResponse>( - service, METHODID_DETACH_SUBSCRIPTION))) + getDetachSubscriptionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.DetachSubscriptionRequest, + com.google.pubsub.v1.DetachSubscriptionResponse>( + service, METHODID_DETACH_SUBSCRIPTION))) .build(); } - private static abstract class PublisherBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + private abstract static class PublisherBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { PublisherBaseDescriptorSupplier() {} @java.lang.Override @@ -1053,18 +1291,20 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { synchronized (PublisherGrpc.class) { result = serviceDescriptor; if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new PublisherFileDescriptorSupplier()) - .addMethod(getCreateTopicMethod()) - .addMethod(getUpdateTopicMethod()) - .addMethod(getPublishMethod()) - .addMethod(getGetTopicMethod()) - .addMethod(getListTopicsMethod()) - .addMethod(getListTopicSubscriptionsMethod()) - .addMethod(getListTopicSnapshotsMethod()) - .addMethod(getDeleteTopicMethod()) - .addMethod(getDetachSubscriptionMethod()) - .build(); + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new PublisherFileDescriptorSupplier()) + .addMethod(getCreateTopicMethod()) + .addMethod(getUpdateTopicMethod()) + .addMethod(getPublishMethod()) + .addMethod(getGetTopicMethod()) + .addMethod(getListTopicsMethod()) + .addMethod(getListTopicSubscriptionsMethod()) + .addMethod(getListTopicSnapshotsMethod()) + .addMethod(getDeleteTopicMethod()) + .addMethod(getDetachSubscriptionMethod()) + .build(); } } } diff --git a/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaServiceGrpc.java b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaServiceGrpc.java new file mode 100644 index 000000000..3b11ea3dc --- /dev/null +++ b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SchemaServiceGrpc.java @@ -0,0 +1,1377 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.pubsub.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + * + * Service for doing schema-related operations. + *+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/pubsub/v1/schema.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class SchemaServiceGrpc { + + private SchemaServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.pubsub.v1.SchemaService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.CreateSchemaRequest, com.google.pubsub.v1.Schema> + getCreateSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSchema", + requestType = com.google.pubsub.v1.CreateSchemaRequest.class, + responseType = com.google.pubsub.v1.Schema.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.CreateSchemaRequest, com.google.pubsub.v1.Schema> + getCreateSchemaMethod() { + io.grpc.MethodDescriptor+ getCreateSchemaMethod; + if ((getCreateSchemaMethod = SchemaServiceGrpc.getCreateSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getCreateSchemaMethod = SchemaServiceGrpc.getCreateSchemaMethod) == null) { + SchemaServiceGrpc.getCreateSchemaMethod = + getCreateSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.CreateSchemaRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Schema.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("CreateSchema")) + .build(); + } + } + } + return getCreateSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.GetSchemaRequest, com.google.pubsub.v1.Schema> + getGetSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSchema", + requestType = com.google.pubsub.v1.GetSchemaRequest.class, + responseType = com.google.pubsub.v1.Schema.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.GetSchemaRequest, com.google.pubsub.v1.Schema> + getGetSchemaMethod() { + io.grpc.MethodDescriptor + getGetSchemaMethod; + if ((getGetSchemaMethod = SchemaServiceGrpc.getGetSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getGetSchemaMethod = SchemaServiceGrpc.getGetSchemaMethod) == null) { + SchemaServiceGrpc.getGetSchemaMethod = + getGetSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.GetSchemaRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Schema.getDefaultInstance())) + .setSchemaDescriptor(new SchemaServiceMethodDescriptorSupplier("GetSchema")) + .build(); + } + } + } + return getGetSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListSchemasRequest, com.google.pubsub.v1.ListSchemasResponse> + getListSchemasMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSchemas", + requestType = com.google.pubsub.v1.ListSchemasRequest.class, + responseType = com.google.pubsub.v1.ListSchemasResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListSchemasRequest, com.google.pubsub.v1.ListSchemasResponse> + getListSchemasMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListSchemasRequest, com.google.pubsub.v1.ListSchemasResponse> + getListSchemasMethod; + if ((getListSchemasMethod = SchemaServiceGrpc.getListSchemasMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getListSchemasMethod = SchemaServiceGrpc.getListSchemasMethod) == null) { + SchemaServiceGrpc.getListSchemasMethod = + getListSchemasMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSchemas")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListSchemasRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListSchemasResponse.getDefaultInstance())) + .setSchemaDescriptor(new SchemaServiceMethodDescriptorSupplier("ListSchemas")) + .build(); + } + } + } + return getListSchemasMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListSchemaRevisionsRequest, + com.google.pubsub.v1.ListSchemaRevisionsResponse> + getListSchemaRevisionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSchemaRevisions", + requestType = com.google.pubsub.v1.ListSchemaRevisionsRequest.class, + responseType = com.google.pubsub.v1.ListSchemaRevisionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListSchemaRevisionsRequest, + com.google.pubsub.v1.ListSchemaRevisionsResponse> + getListSchemaRevisionsMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListSchemaRevisionsRequest, + com.google.pubsub.v1.ListSchemaRevisionsResponse> + getListSchemaRevisionsMethod; + if ((getListSchemaRevisionsMethod = SchemaServiceGrpc.getListSchemaRevisionsMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getListSchemaRevisionsMethod = SchemaServiceGrpc.getListSchemaRevisionsMethod) + == null) { + SchemaServiceGrpc.getListSchemaRevisionsMethod = + getListSchemaRevisionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListSchemaRevisions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListSchemaRevisionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListSchemaRevisionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("ListSchemaRevisions")) + .build(); + } + } + } + return getListSchemaRevisionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.CommitSchemaRequest, com.google.pubsub.v1.Schema> + getCommitSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CommitSchema", + requestType = com.google.pubsub.v1.CommitSchemaRequest.class, + responseType = com.google.pubsub.v1.Schema.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.CommitSchemaRequest, com.google.pubsub.v1.Schema> + getCommitSchemaMethod() { + io.grpc.MethodDescriptor + getCommitSchemaMethod; + if ((getCommitSchemaMethod = SchemaServiceGrpc.getCommitSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getCommitSchemaMethod = SchemaServiceGrpc.getCommitSchemaMethod) == null) { + SchemaServiceGrpc.getCommitSchemaMethod = + getCommitSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CommitSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.CommitSchemaRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Schema.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("CommitSchema")) + .build(); + } + } + } + return getCommitSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.RollbackSchemaRequest, com.google.pubsub.v1.Schema> + getRollbackSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RollbackSchema", + requestType = com.google.pubsub.v1.RollbackSchemaRequest.class, + responseType = com.google.pubsub.v1.Schema.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.RollbackSchemaRequest, com.google.pubsub.v1.Schema> + getRollbackSchemaMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.RollbackSchemaRequest, com.google.pubsub.v1.Schema> + getRollbackSchemaMethod; + if ((getRollbackSchemaMethod = SchemaServiceGrpc.getRollbackSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getRollbackSchemaMethod = SchemaServiceGrpc.getRollbackSchemaMethod) == null) { + SchemaServiceGrpc.getRollbackSchemaMethod = + getRollbackSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RollbackSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.RollbackSchemaRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Schema.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("RollbackSchema")) + .build(); + } + } + } + return getRollbackSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.DeleteSchemaRevisionRequest, com.google.pubsub.v1.Schema> + getDeleteSchemaRevisionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSchemaRevision", + requestType = com.google.pubsub.v1.DeleteSchemaRevisionRequest.class, + responseType = com.google.pubsub.v1.Schema.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.DeleteSchemaRevisionRequest, com.google.pubsub.v1.Schema> + getDeleteSchemaRevisionMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.DeleteSchemaRevisionRequest, com.google.pubsub.v1.Schema> + getDeleteSchemaRevisionMethod; + if ((getDeleteSchemaRevisionMethod = SchemaServiceGrpc.getDeleteSchemaRevisionMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getDeleteSchemaRevisionMethod = SchemaServiceGrpc.getDeleteSchemaRevisionMethod) + == null) { + SchemaServiceGrpc.getDeleteSchemaRevisionMethod = + getDeleteSchemaRevisionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "DeleteSchemaRevision")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.DeleteSchemaRevisionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Schema.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("DeleteSchemaRevision")) + .build(); + } + } + } + return getDeleteSchemaRevisionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.DeleteSchemaRequest, com.google.protobuf.Empty> + getDeleteSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSchema", + requestType = com.google.pubsub.v1.DeleteSchemaRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.DeleteSchemaRequest, com.google.protobuf.Empty> + getDeleteSchemaMethod() { + io.grpc.MethodDescriptor + getDeleteSchemaMethod; + if ((getDeleteSchemaMethod = SchemaServiceGrpc.getDeleteSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getDeleteSchemaMethod = SchemaServiceGrpc.getDeleteSchemaMethod) == null) { + SchemaServiceGrpc.getDeleteSchemaMethod = + getDeleteSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.DeleteSchemaRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("DeleteSchema")) + .build(); + } + } + } + return getDeleteSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.ValidateSchemaRequest, com.google.pubsub.v1.ValidateSchemaResponse> + getValidateSchemaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ValidateSchema", + requestType = com.google.pubsub.v1.ValidateSchemaRequest.class, + responseType = com.google.pubsub.v1.ValidateSchemaResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.ValidateSchemaRequest, com.google.pubsub.v1.ValidateSchemaResponse> + getValidateSchemaMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.ValidateSchemaRequest, com.google.pubsub.v1.ValidateSchemaResponse> + getValidateSchemaMethod; + if ((getValidateSchemaMethod = SchemaServiceGrpc.getValidateSchemaMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getValidateSchemaMethod = SchemaServiceGrpc.getValidateSchemaMethod) == null) { + SchemaServiceGrpc.getValidateSchemaMethod = + getValidateSchemaMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ValidateSchema")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ValidateSchemaRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ValidateSchemaResponse.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("ValidateSchema")) + .build(); + } + } + } + return getValidateSchemaMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.ValidateMessageRequest, com.google.pubsub.v1.ValidateMessageResponse> + getValidateMessageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ValidateMessage", + requestType = com.google.pubsub.v1.ValidateMessageRequest.class, + responseType = com.google.pubsub.v1.ValidateMessageResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.ValidateMessageRequest, com.google.pubsub.v1.ValidateMessageResponse> + getValidateMessageMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.ValidateMessageRequest, + com.google.pubsub.v1.ValidateMessageResponse> + getValidateMessageMethod; + if ((getValidateMessageMethod = SchemaServiceGrpc.getValidateMessageMethod) == null) { + synchronized (SchemaServiceGrpc.class) { + if ((getValidateMessageMethod = SchemaServiceGrpc.getValidateMessageMethod) == null) { + SchemaServiceGrpc.getValidateMessageMethod = + getValidateMessageMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ValidateMessage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ValidateMessageRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ValidateMessageResponse.getDefaultInstance())) + .setSchemaDescriptor( + new SchemaServiceMethodDescriptorSupplier("ValidateMessage")) + .build(); + } + } + } + return getValidateMessageMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static SchemaServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory () { + @java.lang.Override + public SchemaServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceStub(channel, callOptions); + } + }; + return SchemaServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SchemaServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory () { + @java.lang.Override + public SchemaServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceBlockingStub(channel, callOptions); + } + }; + return SchemaServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static SchemaServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory () { + @java.lang.Override + public SchemaServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceFutureStub(channel, callOptions); + } + }; + return SchemaServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + * + * Service for doing schema-related operations. + *+ */ + public interface AsyncService { + + /** + * + * + *+ * Creates a schema. + *+ */ + default void createSchema( + com.google.pubsub.v1.CreateSchemaRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSchemaMethod(), responseObserver); + } + + /** + * + * + * + * Gets a schema. + *+ */ + default void getSchema( + com.google.pubsub.v1.GetSchemaRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSchemaMethod(), responseObserver); + } + + /** + * + * + * + * Lists schemas in a project. + *+ */ + default void listSchemas( + com.google.pubsub.v1.ListSchemasRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSchemasMethod(), responseObserver); + } + + /** + * + * + * + * Lists all schema revisions for the named schema. + *+ */ + default void listSchemaRevisions( + com.google.pubsub.v1.ListSchemaRevisionsRequest request, + io.grpc.stub.StreamObserver+ responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSchemaRevisionsMethod(), responseObserver); + } + + /** + * + * + * + * Commits a new schema revision to an existing schema. + *+ */ + default void commitSchema( + com.google.pubsub.v1.CommitSchemaRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCommitSchemaMethod(), responseObserver); + } + + /** + * + * + * + * Creates a new schema revision that is a copy of the provided revision_id. + *+ */ + default void rollbackSchema( + com.google.pubsub.v1.RollbackSchemaRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRollbackSchemaMethod(), responseObserver); + } + + /** + * + * + * + * Deletes a specific schema revision. + *+ */ + default void deleteSchemaRevision( + com.google.pubsub.v1.DeleteSchemaRevisionRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSchemaRevisionMethod(), responseObserver); + } + + /** + * + * + * + * Deletes a schema. + *+ */ + default void deleteSchema( + com.google.pubsub.v1.DeleteSchemaRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSchemaMethod(), responseObserver); + } + + /** + * + * + * + * Validates a schema. + *+ */ + default void validateSchema( + com.google.pubsub.v1.ValidateSchemaRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getValidateSchemaMethod(), responseObserver); + } + + /** + * + * + * + * Validates a message against a schema. + *+ */ + default void validateMessage( + com.google.pubsub.v1.ValidateMessageRequest request, + io.grpc.stub.StreamObserver+ responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getValidateMessageMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service SchemaService. + * + * + * Service for doing schema-related operations. + *+ */ + public abstract static class SchemaServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SchemaServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service SchemaService. + * + *+ * Service for doing schema-related operations. + *+ */ + public static final class SchemaServiceStub + extends io.grpc.stub.AbstractAsyncStub{ + private SchemaServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SchemaServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceStub(channel, callOptions); + } + + /** + * + * + * + * Creates a schema. + *+ */ + public void createSchema( + com.google.pubsub.v1.CreateSchemaRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + * + * Gets a schema. + *+ */ + public void getSchema( + com.google.pubsub.v1.GetSchemaRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSchemaMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + * + * Lists schemas in a project. + *+ */ + public void listSchemas( + com.google.pubsub.v1.ListSchemasRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSchemasMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + * + * Lists all schema revisions for the named schema. + *+ */ + public void listSchemaRevisions( + com.google.pubsub.v1.ListSchemaRevisionsRequest request, + io.grpc.stub.StreamObserver+ responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSchemaRevisionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + * + * Commits a new schema revision to an existing schema. + *+ */ + public void commitSchema( + com.google.pubsub.v1.CommitSchemaRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCommitSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + * + * Creates a new schema revision that is a copy of the provided revision_id. + *+ */ + public void rollbackSchema( + com.google.pubsub.v1.RollbackSchemaRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRollbackSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + * + * Deletes a specific schema revision. + *+ */ + public void deleteSchemaRevision( + com.google.pubsub.v1.DeleteSchemaRevisionRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSchemaRevisionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + * + * Deletes a schema. + *+ */ + public void deleteSchema( + com.google.pubsub.v1.DeleteSchemaRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + * + * Validates a schema. + *+ */ + public void validateSchema( + com.google.pubsub.v1.ValidateSchemaRequest request, + io.grpc.stub.StreamObserverresponseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getValidateSchemaMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + * + * Validates a message against a schema. + *+ */ + public void validateMessage( + com.google.pubsub.v1.ValidateMessageRequest request, + io.grpc.stub.StreamObserver+ responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getValidateMessageMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service SchemaService. + * + * + * Service for doing schema-related operations. + *+ */ + public static final class SchemaServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub{ + private SchemaServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SchemaServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceBlockingStub(channel, callOptions); + } + + /** + * + * + * + * Creates a schema. + *+ */ + public com.google.pubsub.v1.Schema createSchema( + com.google.pubsub.v1.CreateSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *+ * Gets a schema. + *+ */ + public com.google.pubsub.v1.Schema getSchema(com.google.pubsub.v1.GetSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *+ * Lists schemas in a project. + *+ */ + public com.google.pubsub.v1.ListSchemasResponse listSchemas( + com.google.pubsub.v1.ListSchemasRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSchemasMethod(), getCallOptions(), request); + } + + /** + * + * + *+ * Lists all schema revisions for the named schema. + *+ */ + public com.google.pubsub.v1.ListSchemaRevisionsResponse listSchemaRevisions( + com.google.pubsub.v1.ListSchemaRevisionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSchemaRevisionsMethod(), getCallOptions(), request); + } + + /** + * + * + *+ * Commits a new schema revision to an existing schema. + *+ */ + public com.google.pubsub.v1.Schema commitSchema( + com.google.pubsub.v1.CommitSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCommitSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *+ * Creates a new schema revision that is a copy of the provided revision_id. + *+ */ + public com.google.pubsub.v1.Schema rollbackSchema( + com.google.pubsub.v1.RollbackSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRollbackSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *+ * Deletes a specific schema revision. + *+ */ + public com.google.pubsub.v1.Schema deleteSchemaRevision( + com.google.pubsub.v1.DeleteSchemaRevisionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSchemaRevisionMethod(), getCallOptions(), request); + } + + /** + * + * + *+ * Deletes a schema. + *+ */ + public com.google.protobuf.Empty deleteSchema( + com.google.pubsub.v1.DeleteSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *+ * Validates a schema. + *+ */ + public com.google.pubsub.v1.ValidateSchemaResponse validateSchema( + com.google.pubsub.v1.ValidateSchemaRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getValidateSchemaMethod(), getCallOptions(), request); + } + + /** + * + * + *+ * Validates a message against a schema. + *+ */ + public com.google.pubsub.v1.ValidateMessageResponse validateMessage( + com.google.pubsub.v1.ValidateMessageRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getValidateMessageMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service SchemaService. + * + *+ * Service for doing schema-related operations. + *+ */ + public static final class SchemaServiceFutureStub + extends io.grpc.stub.AbstractFutureStub{ + private SchemaServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SchemaServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SchemaServiceFutureStub(channel, callOptions); + } + + /** + * + * + * + * Creates a schema. + *+ */ + public com.google.common.util.concurrent.ListenableFuture+ createSchema(com.google.pubsub.v1.CreateSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + * + * Gets a schema. + *+ */ + public com.google.common.util.concurrent.ListenableFuture+ getSchema(com.google.pubsub.v1.GetSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + * + * Lists schemas in a project. + *+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.pubsub.v1.ListSchemasResponse> + listSchemas(com.google.pubsub.v1.ListSchemasRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSchemasMethod(), getCallOptions()), request); + } + + /** + * + * + *+ * Lists all schema revisions for the named schema. + *+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.pubsub.v1.ListSchemaRevisionsResponse> + listSchemaRevisions(com.google.pubsub.v1.ListSchemaRevisionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSchemaRevisionsMethod(), getCallOptions()), request); + } + + /** + * + * + *+ * Commits a new schema revision to an existing schema. + *+ */ + public com.google.common.util.concurrent.ListenableFuture+ commitSchema(com.google.pubsub.v1.CommitSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCommitSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + * + * Creates a new schema revision that is a copy of the provided revision_id. + *+ */ + public com.google.common.util.concurrent.ListenableFuture+ rollbackSchema(com.google.pubsub.v1.RollbackSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRollbackSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + * + * Deletes a specific schema revision. + *+ */ + public com.google.common.util.concurrent.ListenableFuture+ deleteSchemaRevision(com.google.pubsub.v1.DeleteSchemaRevisionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSchemaRevisionMethod(), getCallOptions()), request); + } + + /** + * + * + * + * Deletes a schema. + *+ */ + public com.google.common.util.concurrent.ListenableFuture+ deleteSchema(com.google.pubsub.v1.DeleteSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + * + * Validates a schema. + *+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.pubsub.v1.ValidateSchemaResponse> + validateSchema(com.google.pubsub.v1.ValidateSchemaRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getValidateSchemaMethod(), getCallOptions()), request); + } + + /** + * + * + *+ * Validates a message against a schema. + *+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.pubsub.v1.ValidateMessageResponse> + validateMessage(com.google.pubsub.v1.ValidateMessageRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getValidateMessageMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SCHEMA = 0; + private static final int METHODID_GET_SCHEMA = 1; + private static final int METHODID_LIST_SCHEMAS = 2; + private static final int METHODID_LIST_SCHEMA_REVISIONS = 3; + private static final int METHODID_COMMIT_SCHEMA = 4; + private static final int METHODID_ROLLBACK_SCHEMA = 5; + private static final int METHODID_DELETE_SCHEMA_REVISION = 6; + private static final int METHODID_DELETE_SCHEMA = 7; + private static final int METHODID_VALIDATE_SCHEMA = 8; + private static final int METHODID_VALIDATE_MESSAGE = 9; + + private static final class MethodHandlers+ implements io.grpc.stub.ServerCalls.UnaryMethod , + io.grpc.stub.ServerCalls.ServerStreamingMethod , + io.grpc.stub.ServerCalls.ClientStreamingMethod , + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_SCHEMA: + serviceImpl.createSchema( + (com.google.pubsub.v1.CreateSchemaRequest) request, + (io.grpc.stub.StreamObserver ) responseObserver); + break; + case METHODID_GET_SCHEMA: + serviceImpl.getSchema( + (com.google.pubsub.v1.GetSchemaRequest) request, + (io.grpc.stub.StreamObserver ) responseObserver); + break; + case METHODID_LIST_SCHEMAS: + serviceImpl.listSchemas( + (com.google.pubsub.v1.ListSchemasRequest) request, + (io.grpc.stub.StreamObserver ) + responseObserver); + break; + case METHODID_LIST_SCHEMA_REVISIONS: + serviceImpl.listSchemaRevisions( + (com.google.pubsub.v1.ListSchemaRevisionsRequest) request, + (io.grpc.stub.StreamObserver ) + responseObserver); + break; + case METHODID_COMMIT_SCHEMA: + serviceImpl.commitSchema( + (com.google.pubsub.v1.CommitSchemaRequest) request, + (io.grpc.stub.StreamObserver ) responseObserver); + break; + case METHODID_ROLLBACK_SCHEMA: + serviceImpl.rollbackSchema( + (com.google.pubsub.v1.RollbackSchemaRequest) request, + (io.grpc.stub.StreamObserver ) responseObserver); + break; + case METHODID_DELETE_SCHEMA_REVISION: + serviceImpl.deleteSchemaRevision( + (com.google.pubsub.v1.DeleteSchemaRevisionRequest) request, + (io.grpc.stub.StreamObserver ) responseObserver); + break; + case METHODID_DELETE_SCHEMA: + serviceImpl.deleteSchema( + (com.google.pubsub.v1.DeleteSchemaRequest) request, + (io.grpc.stub.StreamObserver ) responseObserver); + break; + case METHODID_VALIDATE_SCHEMA: + serviceImpl.validateSchema( + (com.google.pubsub.v1.ValidateSchemaRequest) request, + (io.grpc.stub.StreamObserver ) + responseObserver); + break; + case METHODID_VALIDATE_MESSAGE: + serviceImpl.validateMessage( + (com.google.pubsub.v1.ValidateMessageRequest) request, + (io.grpc.stub.StreamObserver ) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.CreateSchemaRequest, com.google.pubsub.v1.Schema>( + service, METHODID_CREATE_SCHEMA))) + .addMethod( + getGetSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.GetSchemaRequest, com.google.pubsub.v1.Schema>( + service, METHODID_GET_SCHEMA))) + .addMethod( + getListSchemasMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.ListSchemasRequest, + com.google.pubsub.v1.ListSchemasResponse>(service, METHODID_LIST_SCHEMAS))) + .addMethod( + getListSchemaRevisionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.ListSchemaRevisionsRequest, + com.google.pubsub.v1.ListSchemaRevisionsResponse>( + service, METHODID_LIST_SCHEMA_REVISIONS))) + .addMethod( + getCommitSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.CommitSchemaRequest, com.google.pubsub.v1.Schema>( + service, METHODID_COMMIT_SCHEMA))) + .addMethod( + getRollbackSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.RollbackSchemaRequest, com.google.pubsub.v1.Schema>( + service, METHODID_ROLLBACK_SCHEMA))) + .addMethod( + getDeleteSchemaRevisionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.DeleteSchemaRevisionRequest, com.google.pubsub.v1.Schema>( + service, METHODID_DELETE_SCHEMA_REVISION))) + .addMethod( + getDeleteSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.DeleteSchemaRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_SCHEMA))) + .addMethod( + getValidateSchemaMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.ValidateSchemaRequest, + com.google.pubsub.v1.ValidateSchemaResponse>( + service, METHODID_VALIDATE_SCHEMA))) + .addMethod( + getValidateMessageMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.pubsub.v1.ValidateMessageRequest, + com.google.pubsub.v1.ValidateMessageResponse>( + service, METHODID_VALIDATE_MESSAGE))) + .build(); + } + + private abstract static class SchemaServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SchemaServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.pubsub.v1.SchemaProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("SchemaService"); + } + } + + private static final class SchemaServiceFileDescriptorSupplier + extends SchemaServiceBaseDescriptorSupplier { + SchemaServiceFileDescriptorSupplier() {} + } + + private static final class SchemaServiceMethodDescriptorSupplier + extends SchemaServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + SchemaServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SchemaServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SchemaServiceFileDescriptorSupplier()) + .addMethod(getCreateSchemaMethod()) + .addMethod(getGetSchemaMethod()) + .addMethod(getListSchemasMethod()) + .addMethod(getListSchemaRevisionsMethod()) + .addMethod(getCommitSchemaMethod()) + .addMethod(getRollbackSchemaMethod()) + .addMethod(getDeleteSchemaRevisionMethod()) + .addMethod(getDeleteSchemaMethod()) + .addMethod(getValidateSchemaMethod()) + .addMethod(getValidateMessageMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/owl-bot-staging/v1/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java similarity index 57% rename from owl-bot-staging/v1/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java rename to grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java index 41b2c9d2c..c90e438e8 100644 --- a/owl-bot-staging/v1/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java +++ b/grpc-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/SubscriberGrpc.java @@ -1,8 +1,25 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.google.pubsub.v1; import static io.grpc.MethodDescriptor.generateFullMethodName; /** + * + * * * The service that an application uses to manipulate subscriptions and to * consume messages from a subscription via the `Pull` method or by @@ -20,547 +37,698 @@ private SubscriberGrpc() {} public static final java.lang.String SERVICE_NAME = "google.pubsub.v1.Subscriber"; // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptorgetCreateSubscriptionMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.Subscription, com.google.pubsub.v1.Subscription> + getCreateSubscriptionMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "CreateSubscription", requestType = com.google.pubsub.v1.Subscription.class, responseType = com.google.pubsub.v1.Subscription.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCreateSubscriptionMethod() { - io.grpc.MethodDescriptor getCreateSubscriptionMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.Subscription, com.google.pubsub.v1.Subscription> + getCreateSubscriptionMethod() { + io.grpc.MethodDescriptor + getCreateSubscriptionMethod; if ((getCreateSubscriptionMethod = SubscriberGrpc.getCreateSubscriptionMethod) == null) { synchronized (SubscriberGrpc.class) { if ((getCreateSubscriptionMethod = SubscriberGrpc.getCreateSubscriptionMethod) == null) { - SubscriberGrpc.getCreateSubscriptionMethod = getCreateSubscriptionMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSubscription")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Subscription.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Subscription.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("CreateSubscription")) - .build(); + SubscriberGrpc.getCreateSubscriptionMethod = + getCreateSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Subscription.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Subscription.getDefaultInstance())) + .setSchemaDescriptor( + new SubscriberMethodDescriptorSupplier("CreateSubscription")) + .build(); } } } return getCreateSubscriptionMethod; } - private static volatile io.grpc.MethodDescriptor getGetSubscriptionMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.GetSubscriptionRequest, com.google.pubsub.v1.Subscription> + getGetSubscriptionMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "GetSubscription", requestType = com.google.pubsub.v1.GetSubscriptionRequest.class, responseType = com.google.pubsub.v1.Subscription.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetSubscriptionMethod() { - io.grpc.MethodDescriptor getGetSubscriptionMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.GetSubscriptionRequest, com.google.pubsub.v1.Subscription> + getGetSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.GetSubscriptionRequest, com.google.pubsub.v1.Subscription> + getGetSubscriptionMethod; if ((getGetSubscriptionMethod = SubscriberGrpc.getGetSubscriptionMethod) == null) { synchronized (SubscriberGrpc.class) { if ((getGetSubscriptionMethod = SubscriberGrpc.getGetSubscriptionMethod) == null) { - SubscriberGrpc.getGetSubscriptionMethod = getGetSubscriptionMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSubscription")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.GetSubscriptionRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Subscription.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("GetSubscription")) - .build(); + SubscriberGrpc.getGetSubscriptionMethod = + getGetSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.GetSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Subscription.getDefaultInstance())) + .setSchemaDescriptor( + new SubscriberMethodDescriptorSupplier("GetSubscription")) + .build(); } } } return getGetSubscriptionMethod; } - private static volatile io.grpc.MethodDescriptor getUpdateSubscriptionMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.UpdateSubscriptionRequest, com.google.pubsub.v1.Subscription> + getUpdateSubscriptionMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "UpdateSubscription", requestType = com.google.pubsub.v1.UpdateSubscriptionRequest.class, responseType = com.google.pubsub.v1.Subscription.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getUpdateSubscriptionMethod() { - io.grpc.MethodDescriptor getUpdateSubscriptionMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.UpdateSubscriptionRequest, com.google.pubsub.v1.Subscription> + getUpdateSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.UpdateSubscriptionRequest, com.google.pubsub.v1.Subscription> + getUpdateSubscriptionMethod; if ((getUpdateSubscriptionMethod = SubscriberGrpc.getUpdateSubscriptionMethod) == null) { synchronized (SubscriberGrpc.class) { if ((getUpdateSubscriptionMethod = SubscriberGrpc.getUpdateSubscriptionMethod) == null) { - SubscriberGrpc.getUpdateSubscriptionMethod = getUpdateSubscriptionMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSubscription")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.UpdateSubscriptionRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.Subscription.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("UpdateSubscription")) - .build(); + SubscriberGrpc.getUpdateSubscriptionMethod = + getUpdateSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.UpdateSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.Subscription.getDefaultInstance())) + .setSchemaDescriptor( + new SubscriberMethodDescriptorSupplier("UpdateSubscription")) + .build(); } } } return getUpdateSubscriptionMethod; } - private static volatile io.grpc.MethodDescriptor getListSubscriptionsMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListSubscriptionsRequest, + com.google.pubsub.v1.ListSubscriptionsResponse> + getListSubscriptionsMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "ListSubscriptions", requestType = com.google.pubsub.v1.ListSubscriptionsRequest.class, responseType = com.google.pubsub.v1.ListSubscriptionsResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListSubscriptionsMethod() { - io.grpc.MethodDescriptor getListSubscriptionsMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListSubscriptionsRequest, + com.google.pubsub.v1.ListSubscriptionsResponse> + getListSubscriptionsMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.ListSubscriptionsRequest, + com.google.pubsub.v1.ListSubscriptionsResponse> + getListSubscriptionsMethod; if ((getListSubscriptionsMethod = SubscriberGrpc.getListSubscriptionsMethod) == null) { synchronized (SubscriberGrpc.class) { if ((getListSubscriptionsMethod = SubscriberGrpc.getListSubscriptionsMethod) == null) { - SubscriberGrpc.getListSubscriptionsMethod = getListSubscriptionsMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSubscriptions")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListSubscriptionsRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ListSubscriptionsResponse.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("ListSubscriptions")) - .build(); + SubscriberGrpc.getListSubscriptionsMethod = + getListSubscriptionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSubscriptions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListSubscriptionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ListSubscriptionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new SubscriberMethodDescriptorSupplier("ListSubscriptions")) + .build(); } } } return getListSubscriptionsMethod; } - private static volatile io.grpc.MethodDescriptor getDeleteSubscriptionMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.DeleteSubscriptionRequest, com.google.protobuf.Empty> + getDeleteSubscriptionMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "DeleteSubscription", requestType = com.google.pubsub.v1.DeleteSubscriptionRequest.class, responseType = com.google.protobuf.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDeleteSubscriptionMethod() { - io.grpc.MethodDescriptor getDeleteSubscriptionMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.DeleteSubscriptionRequest, com.google.protobuf.Empty> + getDeleteSubscriptionMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.DeleteSubscriptionRequest, com.google.protobuf.Empty> + getDeleteSubscriptionMethod; if ((getDeleteSubscriptionMethod = SubscriberGrpc.getDeleteSubscriptionMethod) == null) { synchronized (SubscriberGrpc.class) { if ((getDeleteSubscriptionMethod = SubscriberGrpc.getDeleteSubscriptionMethod) == null) { - SubscriberGrpc.getDeleteSubscriptionMethod = getDeleteSubscriptionMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSubscription")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.DeleteSubscriptionRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("DeleteSubscription")) - .build(); + SubscriberGrpc.getDeleteSubscriptionMethod = + getDeleteSubscriptionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSubscription")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.DeleteSubscriptionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new SubscriberMethodDescriptorSupplier("DeleteSubscription")) + .build(); } } } return getDeleteSubscriptionMethod; } - private static volatile io.grpc.MethodDescriptor getModifyAckDeadlineMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.ModifyAckDeadlineRequest, com.google.protobuf.Empty> + getModifyAckDeadlineMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "ModifyAckDeadline", requestType = com.google.pubsub.v1.ModifyAckDeadlineRequest.class, responseType = com.google.protobuf.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getModifyAckDeadlineMethod() { - io.grpc.MethodDescriptor getModifyAckDeadlineMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.ModifyAckDeadlineRequest, com.google.protobuf.Empty> + getModifyAckDeadlineMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.ModifyAckDeadlineRequest, com.google.protobuf.Empty> + getModifyAckDeadlineMethod; if ((getModifyAckDeadlineMethod = SubscriberGrpc.getModifyAckDeadlineMethod) == null) { synchronized (SubscriberGrpc.class) { if ((getModifyAckDeadlineMethod = SubscriberGrpc.getModifyAckDeadlineMethod) == null) { - SubscriberGrpc.getModifyAckDeadlineMethod = getModifyAckDeadlineMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ModifyAckDeadline")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.ModifyAckDeadlineRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("ModifyAckDeadline")) - .build(); + SubscriberGrpc.getModifyAckDeadlineMethod = + getModifyAckDeadlineMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ModifyAckDeadline")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.ModifyAckDeadlineRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new SubscriberMethodDescriptorSupplier("ModifyAckDeadline")) + .build(); } } } return getModifyAckDeadlineMethod; } - private static volatile io.grpc.MethodDescriptor getAcknowledgeMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.AcknowledgeRequest, com.google.protobuf.Empty> + getAcknowledgeMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "Acknowledge", requestType = com.google.pubsub.v1.AcknowledgeRequest.class, responseType = com.google.protobuf.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getAcknowledgeMethod() { - io.grpc.MethodDescriptor getAcknowledgeMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.AcknowledgeRequest, com.google.protobuf.Empty> + getAcknowledgeMethod() { + io.grpc.MethodDescriptor + getAcknowledgeMethod; if ((getAcknowledgeMethod = SubscriberGrpc.getAcknowledgeMethod) == null) { synchronized (SubscriberGrpc.class) { if ((getAcknowledgeMethod = SubscriberGrpc.getAcknowledgeMethod) == null) { - SubscriberGrpc.getAcknowledgeMethod = getAcknowledgeMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Acknowledge")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("Acknowledge")) - .build(); + SubscriberGrpc.getAcknowledgeMethod = + getAcknowledgeMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Acknowledge")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.AcknowledgeRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("Acknowledge")) + .build(); } } } return getAcknowledgeMethod; } - private static volatile io.grpc.MethodDescriptor getPullMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.PullRequest, com.google.pubsub.v1.PullResponse> + getPullMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "Pull", requestType = com.google.pubsub.v1.PullRequest.class, responseType = com.google.pubsub.v1.PullResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getPullMethod() { - io.grpc.MethodDescriptor getPullMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.PullRequest, com.google.pubsub.v1.PullResponse> + getPullMethod() { + io.grpc.MethodDescriptor + getPullMethod; if ((getPullMethod = SubscriberGrpc.getPullMethod) == null) { synchronized (SubscriberGrpc.class) { if ((getPullMethod = SubscriberGrpc.getPullMethod) == null) { - SubscriberGrpc.getPullMethod = getPullMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Pull")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.PullRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.PullResponse.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("Pull")) - .build(); + SubscriberGrpc.getPullMethod = + getPullMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Pull")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.PullRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.PullResponse.getDefaultInstance())) + .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("Pull")) + .build(); } } } return getPullMethod; } - private static volatile io.grpc.MethodDescriptor getStreamingPullMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.StreamingPullRequest, com.google.pubsub.v1.StreamingPullResponse> + getStreamingPullMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "StreamingPull", requestType = com.google.pubsub.v1.StreamingPullRequest.class, responseType = com.google.pubsub.v1.StreamingPullResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getStreamingPullMethod() { - io.grpc.MethodDescriptor getStreamingPullMethod; + public static io.grpc.MethodDescriptor< + com.google.pubsub.v1.StreamingPullRequest, com.google.pubsub.v1.StreamingPullResponse> + getStreamingPullMethod() { + io.grpc.MethodDescriptor< + com.google.pubsub.v1.StreamingPullRequest, com.google.pubsub.v1.StreamingPullResponse> + getStreamingPullMethod; if ((getStreamingPullMethod = SubscriberGrpc.getStreamingPullMethod) == null) { synchronized (SubscriberGrpc.class) { if ((getStreamingPullMethod = SubscriberGrpc.getStreamingPullMethod) == null) { - SubscriberGrpc.getStreamingPullMethod = getStreamingPullMethod = - io.grpc.MethodDescriptor. newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamingPull")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.StreamingPullRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.pubsub.v1.StreamingPullResponse.getDefaultInstance())) - .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("StreamingPull")) - .build(); + SubscriberGrpc.getStreamingPullMethod = + getStreamingPullMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamingPull")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.StreamingPullRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.pubsub.v1.StreamingPullResponse.getDefaultInstance())) + .setSchemaDescriptor(new SubscriberMethodDescriptorSupplier("StreamingPull")) + .build(); } } } return getStreamingPullMethod; } - private static volatile io.grpc.MethodDescriptor getModifyPushConfigMethod; + private static volatile io.grpc.MethodDescriptor< + com.google.pubsub.v1.ModifyPushConfigRequest, com.google.protobuf.Empty> + getModifyPushConfigMethod; @io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "ModifyPushConfig", requestType = com.google.pubsub.v1.ModifyPushConfigRequest.class, responseType = com.google.protobuf.Empty.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getModifyPushConfigMethod() { - io.grpc.MethodDescriptor