From 7e733d20093e0cd492758dd1ff3efc3a72eb1e0c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 12 Jan 2024 20:01:19 -0500 Subject: [PATCH] fix(deps): Update the Java code generator (gapic-generator-java) to 2.31.0 (#1855) --- .../cloud/pubsub/v1/SchemaServiceClient.java | 252 +++++++++++- .../pubsub/v1/SubscriptionAdminClient.java | 364 +++++++++++++++++- .../cloud/pubsub/v1/TopicAdminClient.java | 233 ++++++++++- .../pubsub/v1/stub/PublisherStubSettings.java | 6 + .../v1/stub/SchemaServiceStubSettings.java | 6 + .../v1/stub/SubscriberStubSettings.java | 6 + 6 files changed, 828 insertions(+), 39 deletions(-) diff --git a/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 index 2bf0c15f2..ddc98a2f0 100644 --- a/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 @@ -79,19 +79,245 @@ *

Note: close() needs to be called on the SchemaServiceClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants
CreateSchema

Creates a schema.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createSchema(CreateSchemaRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createSchema(ProjectName parent, Schema schema, String schemaId) + *
  • createSchema(String parent, Schema schema, String schemaId) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createSchemaCallable() + *
+ *
GetSchema

Gets a schema.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getSchema(GetSchemaRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getSchema(SchemaName name) + *
  • getSchema(String name) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getSchemaCallable() + *
+ *
ListSchemas

Lists schemas in a project.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listSchemas(ListSchemasRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listSchemas(ProjectName parent) + *
  • listSchemas(String parent) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listSchemasPagedCallable() + *
  • listSchemasCallable() + *
+ *
ListSchemaRevisions

Lists all schema revisions for the named schema.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listSchemaRevisions(ListSchemaRevisionsRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listSchemaRevisions(SchemaName name) + *
  • listSchemaRevisions(String name) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listSchemaRevisionsPagedCallable() + *
  • listSchemaRevisionsCallable() + *
+ *
CommitSchema

Commits a new schema revision to an existing schema.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • commitSchema(CommitSchemaRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • commitSchema(SchemaName name, Schema schema) + *
  • commitSchema(String name, Schema schema) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • commitSchemaCallable() + *
+ *
RollbackSchema

Creates a new schema revision that is a copy of the provided revision_id.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • rollbackSchema(RollbackSchemaRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • rollbackSchema(SchemaName name, String revisionId) + *
  • rollbackSchema(String name, String revisionId) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • rollbackSchemaCallable() + *
+ *
DeleteSchemaRevision

Deletes a specific schema revision.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteSchemaRevision(DeleteSchemaRevisionRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteSchemaRevision(SchemaName name, String revisionId) + *
  • deleteSchemaRevision(String name, String revisionId) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteSchemaRevisionCallable() + *
+ *
DeleteSchema

Deletes a schema.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteSchema(DeleteSchemaRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteSchema(SchemaName name) + *
  • deleteSchema(String name) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteSchemaCallable() + *
+ *
ValidateSchema

Validates a schema.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • validateSchema(ValidateSchemaRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • validateSchema(ProjectName parent, Schema schema) + *
  • validateSchema(String parent, Schema schema) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • validateSchemaCallable() + *
+ *
ValidateMessage

Validates a message against a schema.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • validateMessage(ValidateMessageRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • validateMessageCallable() + *
+ *
SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy. + *

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

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • setIamPolicy(SetIamPolicyRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • setIamPolicyCallable() + *
+ *
GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getIamPolicy(GetIamPolicyRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIamPolicyCallable() + *
+ *
TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. + *

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • testIamPermissions(TestIamPermissionsRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • testIamPermissionsCallable() + *
+ *
* *

See the individual methods for example code. * diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java index 068970f64..e7617298c 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java @@ -99,19 +99,357 @@ * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants
CreateSubscription

Creates a subscription to a given topic. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#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/pubsub-basics#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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createSubscription(Subscription request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createSubscription(SubscriptionName name, TopicName topic, PushConfig pushConfig, int ackDeadlineSeconds) + *
  • createSubscription(SubscriptionName name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) + *
  • createSubscription(String name, TopicName topic, PushConfig pushConfig, int ackDeadlineSeconds) + *
  • createSubscription(String name, String topic, PushConfig pushConfig, int ackDeadlineSeconds) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createSubscriptionCallable() + *
+ *
GetSubscription

Gets the configuration details of a subscription.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getSubscription(GetSubscriptionRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getSubscription(SubscriptionName subscription) + *
  • getSubscription(String subscription) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getSubscriptionCallable() + *
+ *
UpdateSubscription

Updates an existing subscription. Note that certain properties of a subscription, such as its topic, are not modifiable.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateSubscription(UpdateSubscriptionRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateSubscription(Subscription subscription, FieldMask updateMask) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateSubscriptionCallable() + *
+ *
ListSubscriptions

Lists matching subscriptions.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listSubscriptions(ListSubscriptionsRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listSubscriptions(ProjectName project) + *
  • listSubscriptions(String project) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listSubscriptionsPagedCallable() + *
  • listSubscriptionsCallable() + *
+ *
DeleteSubscription

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteSubscription(DeleteSubscriptionRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteSubscription(SubscriptionName subscription) + *
  • deleteSubscription(String subscription) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteSubscriptionCallable() + *
+ *
ModifyAckDeadline

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • modifyAckDeadline(ModifyAckDeadlineRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • modifyAckDeadline(SubscriptionName subscription, List<String> ackIds, int ackDeadlineSeconds) + *
  • modifyAckDeadline(String subscription, List<String> ackIds, int ackDeadlineSeconds) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • modifyAckDeadlineCallable() + *
+ *
Acknowledge

Acknowledges the messages associated with the `ack_ids` in the `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages from the subscription. + *

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • acknowledge(AcknowledgeRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • acknowledge(SubscriptionName subscription, List<String> ackIds) + *
  • acknowledge(String subscription, List<String> ackIds) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • acknowledgeCallable() + *
+ *
Pull

Pulls messages from the server.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • pull(PullRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • pull(SubscriptionName subscription, int maxMessages) + *
  • pull(String subscription, int maxMessages) + *
  • pull(SubscriptionName subscription, boolean returnImmediately, int maxMessages) + *
  • pull(String subscription, boolean returnImmediately, int maxMessages) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • pullCallable() + *
+ *
StreamingPull

Establishes a stream with the server, which sends messages down to the client. The client streams acknowledgements and ack deadline modifications back to the server. The server will close the stream and return the status on any error. The server may close the stream with status `UNAVAILABLE` to reassign server-side resources, in which case, the client should re-establish the stream. Flow control can be achieved by configuring the underlying RPC channel.

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • streamingPullCallable() + *
+ *
ModifyPushConfig

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`.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • modifyPushConfig(ModifyPushConfigRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • modifyPushConfig(SubscriptionName subscription, PushConfig pushConfig) + *
  • modifyPushConfig(String subscription, PushConfig pushConfig) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • modifyPushConfigCallable() + *
+ *
GetSnapshot

Gets the configuration details of a 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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getSnapshot(GetSnapshotRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getSnapshot(SnapshotName snapshot) + *
  • getSnapshot(String snapshot) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getSnapshotCallable() + *
+ *
ListSnapshots

Lists the existing snapshots. 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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listSnapshots(ListSnapshotsRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listSnapshots(ProjectName project) + *
  • listSnapshots(String project) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listSnapshotsPagedCallable() + *
  • listSnapshotsCallable() + *
+ *
CreateSnapshot

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/pubsub-basics#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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createSnapshot(CreateSnapshotRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createSnapshot(SnapshotName name, SubscriptionName subscription) + *
  • createSnapshot(SnapshotName name, String subscription) + *
  • createSnapshot(String name, SubscriptionName subscription) + *
  • createSnapshot(String name, String subscription) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createSnapshotCallable() + *
+ *
UpdateSnapshot

Updates 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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateSnapshot(UpdateSnapshotRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateSnapshot(Snapshot snapshot, FieldMask updateMask) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateSnapshotCallable() + *
+ *
DeleteSnapshot

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteSnapshot(DeleteSnapshotRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteSnapshot(SnapshotName snapshot) + *
  • deleteSnapshot(String snapshot) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteSnapshotCallable() + *
+ *
Seek

Seeks an existing subscription to a point in time or to a given snapshot, whichever is provided in the request. 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. Note that both the subscription and the snapshot must be on the same topic.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • seek(SeekRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • seekCallable() + *
+ *
SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy. + *

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

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • setIamPolicy(SetIamPolicyRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • setIamPolicyCallable() + *
+ *
GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getIamPolicy(GetIamPolicyRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIamPolicyCallable() + *
+ *
TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. + *

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • testIamPermissions(TestIamPermissionsRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • testIamPermissionsCallable() + *
+ *
* *

See the individual methods for example code. * diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java index b1f0dc35f..4e2652585 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/TopicAdminClient.java @@ -80,19 +80,226 @@ *

Note: close() needs to be called on the TopicAdminClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants
CreateTopic

Creates the given topic with the given name. See the [resource name rules] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createTopic(Topic request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createTopic(TopicName name) + *
  • createTopic(String name) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createTopicCallable() + *
+ *
UpdateTopic

Updates an existing topic. Note that certain properties of a topic are not modifiable.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateTopic(UpdateTopicRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateTopic(Topic topic, FieldMask updateMask) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateTopicCallable() + *
+ *
Publish

Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • publish(PublishRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • publish(TopicName topic, List<PubsubMessage> messages) + *
  • publish(String topic, List<PubsubMessage> messages) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • publishCallable() + *
+ *
GetTopic

Gets the configuration of a topic.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getTopic(GetTopicRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getTopic(TopicName topic) + *
  • getTopic(String topic) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getTopicCallable() + *
+ *
ListTopics

Lists matching topics.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listTopics(ListTopicsRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listTopics(ProjectName project) + *
  • listTopics(String project) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listTopicsPagedCallable() + *
  • listTopicsCallable() + *
+ *
ListTopicSubscriptions

Lists the names of the attached subscriptions on this topic.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listTopicSubscriptions(ListTopicSubscriptionsRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listTopicSubscriptions(TopicName topic) + *
  • listTopicSubscriptions(String topic) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listTopicSubscriptionsPagedCallable() + *
  • listTopicSubscriptionsCallable() + *
+ *
ListTopicSnapshots

Lists the names of the snapshots on this topic. 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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listTopicSnapshots(ListTopicSnapshotsRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listTopicSnapshots(TopicName topic) + *
  • listTopicSnapshots(String topic) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listTopicSnapshotsPagedCallable() + *
  • listTopicSnapshotsCallable() + *
+ *
DeleteTopic

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_`.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteTopic(DeleteTopicRequest request) + *
+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteTopic(TopicName topic) + *
  • deleteTopic(String topic) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteTopicCallable() + *
+ *
DetachSubscription

Detaches a subscription from this topic. All messages retained in the subscription are dropped. Subsequent `Pull` and `StreamingPull` requests will return FAILED_PRECONDITION. If the subscription is a push subscription, pushes to the endpoint will stop.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • detachSubscription(DetachSubscriptionRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • detachSubscriptionCallable() + *
+ *
SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy. + *

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

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • setIamPolicy(SetIamPolicyRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • setIamPolicyCallable() + *
+ *
GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getIamPolicy(GetIamPolicyRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIamPolicyCallable() + *
+ *
TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. + *

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • testIamPermissions(TestIamPermissionsRequest request) + *
+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • testIamPermissionsCallable() + *
+ *
* *

See the individual methods for example code. * diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java index 73510eee0..f3c495688 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java @@ -480,6 +480,12 @@ public PublisherStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "pubsub"; + } + /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return InstantiatingExecutorProvider.newBuilder(); diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java index 3be71b72a..8b036328d 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java @@ -340,6 +340,12 @@ public SchemaServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "pubsub"; + } + /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return InstantiatingExecutorProvider.newBuilder(); diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java index 459c80624..c517f17d6 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java @@ -385,6 +385,12 @@ public SubscriberStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "pubsub"; + } + /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return InstantiatingExecutorProvider.newBuilder();