Cloud Pub/Sub v1 API - Class SubscriberServiceApiClientImpl (3.19.0)

public sealed class SubscriberServiceApiClientImpl : SubscriberServiceApiClient

Reference documentation and code samples for the Cloud Pub/Sub v1 API class SubscriberServiceApiClientImpl.

SubscriberServiceApi client wrapper implementation, for convenient use.

Inheritance

object > SubscriberServiceApiClient > SubscriberServiceApiClientImpl

Namespace

Google.Cloud.PubSub.V1

Assembly

Google.Cloud.PubSub.V1.dll

Remarks

The service that an application uses to manipulate subscriptions and to consume messages from a subscription via the Pull method or by establishing a bi-directional stream using the StreamingPull method.

Constructors

SubscriberServiceApiClientImpl(SubscriberClient, SubscriberServiceApiSettings, ILogger)

public SubscriberServiceApiClientImpl(Subscriber.SubscriberClient grpcClient, SubscriberServiceApiSettings settings, ILogger logger)

Constructs a client wrapper for the SubscriberServiceApi service, with the specified gRPC client and settings.

Parameters
Name Description
grpcClient SubscriberSubscriberClient

The underlying gRPC client.

settings SubscriberServiceApiSettings

The base SubscriberServiceApiSettings used within this client.

logger ILogger

Optional ILogger to use within this client.

Properties

GrpcClient

public override Subscriber.SubscriberClient GrpcClient { get; }

The underlying gRPC SubscriberServiceApi client

Property Value
Type Description
SubscriberSubscriberClient
Overrides

IAMPolicyClient

public override IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
Type Description
IAMPolicyClient
Overrides

Methods

Acknowledge(AcknowledgeRequest, CallSettings)

public override void Acknowledge(AcknowledgeRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request AcknowledgeRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Overrides

AcknowledgeAsync(AcknowledgeRequest, CallSettings)

public override Task AcknowledgeAsync(AcknowledgeRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request AcknowledgeRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Overrides

CreateSnapshot(CreateSnapshotRequest, CallSettings)

public override Snapshot CreateSnapshot(CreateSnapshotRequest request, CallSettings callSettings = null)

Creates a snapshot from the requested subscription. Snapshots are used in Seek 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. The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request.

Parameters
Name Description
request CreateSnapshotRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Snapshot

The RPC response.

Overrides

CreateSnapshotAsync(CreateSnapshotRequest, CallSettings)

public override Task<Snapshot> CreateSnapshotAsync(CreateSnapshotRequest request, CallSettings callSettings = null)

Creates a snapshot from the requested subscription. Snapshots are used in Seek 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. The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request.

Parameters
Name Description
request CreateSnapshotRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSnapshot

A Task containing the RPC response.

Overrides

CreateSubscription(Subscription, CallSettings)

public override Subscription CreateSubscription(Subscription request, CallSettings callSettings = null)

Creates a subscription to a given topic. See the resource name rules. 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. The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.

Parameters
Name Description
request Subscription

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Subscription

The RPC response.

Overrides

CreateSubscriptionAsync(Subscription, CallSettings)

public override Task<Subscription> CreateSubscriptionAsync(Subscription request, CallSettings callSettings = null)

Creates a subscription to a given topic. See the resource name rules. 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. The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.

Parameters
Name Description
request Subscription

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSubscription

A Task containing the RPC response.

Overrides

DeleteSnapshot(DeleteSnapshotRequest, CallSettings)

public override void DeleteSnapshot(DeleteSnapshotRequest request, CallSettings callSettings = null)

Removes an existing snapshot. Snapshots are used in Seek 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.

Parameters
Name Description
request DeleteSnapshotRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Overrides

DeleteSnapshotAsync(DeleteSnapshotRequest, CallSettings)

public override Task DeleteSnapshotAsync(DeleteSnapshotRequest request, CallSettings callSettings = null)

Removes an existing snapshot. Snapshots are used in Seek 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.

Parameters
Name Description
request DeleteSnapshotRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Overrides

DeleteSubscription(DeleteSubscriptionRequest, CallSettings)

public override void DeleteSubscription(DeleteSubscriptionRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request DeleteSubscriptionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Overrides

DeleteSubscriptionAsync(DeleteSubscriptionRequest, CallSettings)

public override Task DeleteSubscriptionAsync(DeleteSubscriptionRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request DeleteSubscriptionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Overrides

GetSnapshot(GetSnapshotRequest, CallSettings)

public override Snapshot GetSnapshot(GetSnapshotRequest request, CallSettings callSettings = null)

Gets the configuration details of a snapshot. Snapshots are used in Seek 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.

Parameters
Name Description
request GetSnapshotRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Snapshot

The RPC response.

Overrides

GetSnapshotAsync(GetSnapshotRequest, CallSettings)

public override Task<Snapshot> GetSnapshotAsync(GetSnapshotRequest request, CallSettings callSettings = null)

Gets the configuration details of a snapshot. Snapshots are used in Seek 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.

Parameters
Name Description
request GetSnapshotRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSnapshot

A Task containing the RPC response.

Overrides

GetSubscription(GetSubscriptionRequest, CallSettings)

public override Subscription GetSubscription(GetSubscriptionRequest request, CallSettings callSettings = null)

Gets the configuration details of a subscription.

Parameters
Name Description
request GetSubscriptionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Subscription

The RPC response.

Overrides

GetSubscriptionAsync(GetSubscriptionRequest, CallSettings)

public override Task<Subscription> GetSubscriptionAsync(GetSubscriptionRequest request, CallSettings callSettings = null)

Gets the configuration details of a subscription.

Parameters
Name Description
request GetSubscriptionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSubscription

A Task containing the RPC response.

Overrides

ListSnapshots(ListSnapshotsRequest, CallSettings)

public override PagedEnumerable<ListSnapshotsResponse, Snapshot> ListSnapshots(ListSnapshotsRequest request, CallSettings callSettings = null)

Lists the existing snapshots. Snapshots are used in Seek 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.

Parameters
Name Description
request ListSnapshotsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListSnapshotsResponseSnapshot

A pageable sequence of Snapshot resources.

Overrides

ListSnapshotsAsync(ListSnapshotsRequest, CallSettings)

public override PagedAsyncEnumerable<ListSnapshotsResponse, Snapshot> ListSnapshotsAsync(ListSnapshotsRequest request, CallSettings callSettings = null)

Lists the existing snapshots. Snapshots are used in Seek 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.

Parameters
Name Description
request ListSnapshotsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListSnapshotsResponseSnapshot

A pageable asynchronous sequence of Snapshot resources.

Overrides

ListSubscriptions(ListSubscriptionsRequest, CallSettings)

public override PagedEnumerable<ListSubscriptionsResponse, Subscription> ListSubscriptions(ListSubscriptionsRequest request, CallSettings callSettings = null)

Lists matching subscriptions.

Parameters
Name Description
request ListSubscriptionsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListSubscriptionsResponseSubscription

A pageable sequence of Subscription resources.

Overrides

ListSubscriptionsAsync(ListSubscriptionsRequest, CallSettings)

public override PagedAsyncEnumerable<ListSubscriptionsResponse, Subscription> ListSubscriptionsAsync(ListSubscriptionsRequest request, CallSettings callSettings = null)

Lists matching subscriptions.

Parameters
Name Description
request ListSubscriptionsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListSubscriptionsResponseSubscription

A pageable asynchronous sequence of Subscription resources.

Overrides

ModifyAckDeadline(ModifyAckDeadlineRequest, CallSettings)

public override void ModifyAckDeadline(ModifyAckDeadlineRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request ModifyAckDeadlineRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Overrides

ModifyAckDeadlineAsync(ModifyAckDeadlineRequest, CallSettings)

public override Task ModifyAckDeadlineAsync(ModifyAckDeadlineRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request ModifyAckDeadlineRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Overrides

ModifyPushConfig(ModifyPushConfigRequest, CallSettings)

public override void ModifyPushConfig(ModifyPushConfigRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request ModifyPushConfigRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Overrides

ModifyPushConfigAsync(ModifyPushConfigRequest, CallSettings)

public override Task ModifyPushConfigAsync(ModifyPushConfigRequest request, CallSettings callSettings = null)

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.

Parameters
Name Description
request ModifyPushConfigRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Overrides

Pull(PullRequest, CallSettings)

public override PullResponse Pull(PullRequest request, CallSettings callSettings = null)

Pulls messages from the server.

Parameters
Name Description
request PullRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PullResponse

The RPC response.

Overrides

PullAsync(PullRequest, CallSettings)

public override Task<PullResponse> PullAsync(PullRequest request, CallSettings callSettings = null)

Pulls messages from the server.

Parameters
Name Description
request PullRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPullResponse

A Task containing the RPC response.

Overrides

Seek(SeekRequest, CallSettings)

public override SeekResponse Seek(SeekRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request SeekRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SeekResponse

The RPC response.

Overrides

SeekAsync(SeekRequest, CallSettings)

public override Task<SeekResponse> SeekAsync(SeekRequest request, CallSettings callSettings = null)

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

Parameters
Name Description
request SeekRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSeekResponse

A Task containing the RPC response.

Overrides

StreamingPull(CallSettings, BidirectionalStreamingSettings)

public override SubscriberServiceApiClient.StreamingPullStream StreamingPull(CallSettings callSettings = null, BidirectionalStreamingSettings streamingSettings = null)

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.

Parameters
Name Description
callSettings CallSettings

If not null, applies overrides to this RPC call.

streamingSettings BidirectionalStreamingSettings

If not null, applies streaming overrides to this RPC call.

Returns
Type Description
SubscriberServiceApiClientStreamingPullStream

The client-server stream.

Overrides

UpdateSnapshot(UpdateSnapshotRequest, CallSettings)

public override Snapshot UpdateSnapshot(UpdateSnapshotRequest request, CallSettings callSettings = null)

Updates an existing snapshot by updating the fields specified in the update mask. Snapshots are used in Seek 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.

Parameters
Name Description
request UpdateSnapshotRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Snapshot

The RPC response.

Overrides

UpdateSnapshotAsync(UpdateSnapshotRequest, CallSettings)

public override Task<Snapshot> UpdateSnapshotAsync(UpdateSnapshotRequest request, CallSettings callSettings = null)

Updates an existing snapshot by updating the fields specified in the update mask. Snapshots are used in Seek 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.

Parameters
Name Description
request UpdateSnapshotRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSnapshot

A Task containing the RPC response.

Overrides

UpdateSubscription(UpdateSubscriptionRequest, CallSettings)

public override Subscription UpdateSubscription(UpdateSubscriptionRequest request, CallSettings callSettings = null)

Updates an existing subscription by updating the fields specified in the update mask. Note that certain properties of a subscription, such as its topic, are not modifiable.

Parameters
Name Description
request UpdateSubscriptionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Subscription

The RPC response.

Overrides

UpdateSubscriptionAsync(UpdateSubscriptionRequest, CallSettings)

public override Task<Subscription> UpdateSubscriptionAsync(UpdateSubscriptionRequest request, CallSettings callSettings = null)

Updates an existing subscription by updating the fields specified in the update mask. Note that certain properties of a subscription, such as its topic, are not modifiable.

Parameters
Name Description
request UpdateSubscriptionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSubscription

A Task containing the RPC response.

Overrides