Cloud Pub/Sub v1 API - Class Subscriber.SubscriberClient (3.18.0)

public class Subscriber.SubscriberClient : ClientBase<Subscriber.SubscriberClient>

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

Client for Subscriber

Inheritance

object > ClientBase > ClientBaseSubscriberSubscriberClient > Subscriber.SubscriberClient

Namespace

Google.Cloud.PubSub.V1

Assembly

Google.Cloud.PubSub.V1.dll

Constructors

SubscriberClient()

protected SubscriberClient()

Protected parameterless constructor to allow creation of test doubles.

SubscriberClient(CallInvoker)

public SubscriberClient(CallInvoker callInvoker)

Creates a new client for Subscriber that uses a custom CallInvoker.

Parameter
Name Description
callInvoker CallInvoker

The callInvoker to use to make remote calls.

SubscriberClient(ChannelBase)

public SubscriberClient(ChannelBase channel)

Creates a new client for Subscriber

Parameter
Name Description
channel ChannelBase

The channel to use to make remote calls.

SubscriberClient(ClientBaseConfiguration)

protected SubscriberClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration

The client configuration.

Methods

Acknowledge(AcknowledgeRequest, CallOptions)

public virtual Empty Acknowledge(AcknowledgeRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Empty

The response received from the server.

Acknowledge(AcknowledgeRequest, Metadata, DateTime?, CancellationToken)

public virtual Empty Acknowledge(AcknowledgeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Empty

The response received from the server.

AcknowledgeAsync(AcknowledgeRequest, CallOptions)

public virtual AsyncUnaryCall<Empty> AcknowledgeAsync(AcknowledgeRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

AcknowledgeAsync(AcknowledgeRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Empty> AcknowledgeAsync(AcknowledgeRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

CreateIAMPolicyClient()

public virtual IAMPolicy.IAMPolicyClient CreateIAMPolicyClient()

Creates a new instance of IAMPolicy.IAMPolicyClient using the same call invoker as this client.

Returns
Type Description
IAMPolicyIAMPolicyClient

A new IAMPolicy.IAMPolicyClient for the same target as this client.

CreateSnapshot(CreateSnapshotRequest, CallOptions)

public virtual Snapshot CreateSnapshot(CreateSnapshotRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Snapshot

The response received from the server.

CreateSnapshot(CreateSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual Snapshot CreateSnapshot(CreateSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Snapshot

The response received from the server.

CreateSnapshotAsync(CreateSnapshotRequest, CallOptions)

public virtual AsyncUnaryCall<Snapshot> CreateSnapshotAsync(CreateSnapshotRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallSnapshot

The call object.

CreateSnapshotAsync(CreateSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Snapshot> CreateSnapshotAsync(CreateSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallSnapshot

The call object.

CreateSubscription(Subscription, CallOptions)

public virtual Subscription CreateSubscription(Subscription request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Subscription

The response received from the server.

CreateSubscription(Subscription, Metadata, DateTime?, CancellationToken)

public virtual Subscription CreateSubscription(Subscription request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Subscription

The response received from the server.

CreateSubscriptionAsync(Subscription, CallOptions)

public virtual AsyncUnaryCall<Subscription> CreateSubscriptionAsync(Subscription request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallSubscription

The call object.

CreateSubscriptionAsync(Subscription, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Subscription> CreateSubscriptionAsync(Subscription request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallSubscription

The call object.

DeleteSnapshot(DeleteSnapshotRequest, CallOptions)

public virtual Empty DeleteSnapshot(DeleteSnapshotRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Empty

The response received from the server.

DeleteSnapshot(DeleteSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual Empty DeleteSnapshot(DeleteSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Empty

The response received from the server.

DeleteSnapshotAsync(DeleteSnapshotRequest, CallOptions)

public virtual AsyncUnaryCall<Empty> DeleteSnapshotAsync(DeleteSnapshotRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

DeleteSnapshotAsync(DeleteSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Empty> DeleteSnapshotAsync(DeleteSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

DeleteSubscription(DeleteSubscriptionRequest, CallOptions)

public virtual Empty DeleteSubscription(DeleteSubscriptionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Empty

The response received from the server.

DeleteSubscription(DeleteSubscriptionRequest, Metadata, DateTime?, CancellationToken)

public virtual Empty DeleteSubscription(DeleteSubscriptionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Empty

The response received from the server.

DeleteSubscriptionAsync(DeleteSubscriptionRequest, CallOptions)

public virtual AsyncUnaryCall<Empty> DeleteSubscriptionAsync(DeleteSubscriptionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

DeleteSubscriptionAsync(DeleteSubscriptionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Empty> DeleteSubscriptionAsync(DeleteSubscriptionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

GetSnapshot(GetSnapshotRequest, CallOptions)

public virtual Snapshot GetSnapshot(GetSnapshotRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Snapshot

The response received from the server.

GetSnapshot(GetSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual Snapshot GetSnapshot(GetSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Snapshot

The response received from the server.

GetSnapshotAsync(GetSnapshotRequest, CallOptions)

public virtual AsyncUnaryCall<Snapshot> GetSnapshotAsync(GetSnapshotRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallSnapshot

The call object.

GetSnapshotAsync(GetSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Snapshot> GetSnapshotAsync(GetSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallSnapshot

The call object.

GetSubscription(GetSubscriptionRequest, CallOptions)

public virtual Subscription GetSubscription(GetSubscriptionRequest request, CallOptions options)

Gets the configuration details of a subscription.

Parameters
Name Description
request GetSubscriptionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Subscription

The response received from the server.

GetSubscription(GetSubscriptionRequest, Metadata, DateTime?, CancellationToken)

public virtual Subscription GetSubscription(GetSubscriptionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets the configuration details of a subscription.

Parameters
Name Description
request GetSubscriptionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Subscription

The response received from the server.

GetSubscriptionAsync(GetSubscriptionRequest, CallOptions)

public virtual AsyncUnaryCall<Subscription> GetSubscriptionAsync(GetSubscriptionRequest request, CallOptions options)

Gets the configuration details of a subscription.

Parameters
Name Description
request GetSubscriptionRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallSubscription

The call object.

GetSubscriptionAsync(GetSubscriptionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Subscription> GetSubscriptionAsync(GetSubscriptionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets the configuration details of a subscription.

Parameters
Name Description
request GetSubscriptionRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallSubscription

The call object.

ListSnapshots(ListSnapshotsRequest, CallOptions)

public virtual ListSnapshotsResponse ListSnapshots(ListSnapshotsRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListSnapshotsResponse

The response received from the server.

ListSnapshots(ListSnapshotsRequest, Metadata, DateTime?, CancellationToken)

public virtual ListSnapshotsResponse ListSnapshots(ListSnapshotsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListSnapshotsResponse

The response received from the server.

ListSnapshotsAsync(ListSnapshotsRequest, CallOptions)

public virtual AsyncUnaryCall<ListSnapshotsResponse> ListSnapshotsAsync(ListSnapshotsRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListSnapshotsResponse

The call object.

ListSnapshotsAsync(ListSnapshotsRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListSnapshotsResponse> ListSnapshotsAsync(ListSnapshotsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListSnapshotsResponse

The call object.

ListSubscriptions(ListSubscriptionsRequest, CallOptions)

public virtual ListSubscriptionsResponse ListSubscriptions(ListSubscriptionsRequest request, CallOptions options)

Lists matching subscriptions.

Parameters
Name Description
request ListSubscriptionsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
ListSubscriptionsResponse

The response received from the server.

ListSubscriptions(ListSubscriptionsRequest, Metadata, DateTime?, CancellationToken)

public virtual ListSubscriptionsResponse ListSubscriptions(ListSubscriptionsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists matching subscriptions.

Parameters
Name Description
request ListSubscriptionsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
ListSubscriptionsResponse

The response received from the server.

ListSubscriptionsAsync(ListSubscriptionsRequest, CallOptions)

public virtual AsyncUnaryCall<ListSubscriptionsResponse> ListSubscriptionsAsync(ListSubscriptionsRequest request, CallOptions options)

Lists matching subscriptions.

Parameters
Name Description
request ListSubscriptionsRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallListSubscriptionsResponse

The call object.

ListSubscriptionsAsync(ListSubscriptionsRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<ListSubscriptionsResponse> ListSubscriptionsAsync(ListSubscriptionsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists matching subscriptions.

Parameters
Name Description
request ListSubscriptionsRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallListSubscriptionsResponse

The call object.

ModifyAckDeadline(ModifyAckDeadlineRequest, CallOptions)

public virtual Empty ModifyAckDeadline(ModifyAckDeadlineRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Empty

The response received from the server.

ModifyAckDeadline(ModifyAckDeadlineRequest, Metadata, DateTime?, CancellationToken)

public virtual Empty ModifyAckDeadline(ModifyAckDeadlineRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Empty

The response received from the server.

ModifyAckDeadlineAsync(ModifyAckDeadlineRequest, CallOptions)

public virtual AsyncUnaryCall<Empty> ModifyAckDeadlineAsync(ModifyAckDeadlineRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

ModifyAckDeadlineAsync(ModifyAckDeadlineRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Empty> ModifyAckDeadlineAsync(ModifyAckDeadlineRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

ModifyPushConfig(ModifyPushConfigRequest, CallOptions)

public virtual Empty ModifyPushConfig(ModifyPushConfigRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Empty

The response received from the server.

ModifyPushConfig(ModifyPushConfigRequest, Metadata, DateTime?, CancellationToken)

public virtual Empty ModifyPushConfig(ModifyPushConfigRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Empty

The response received from the server.

ModifyPushConfigAsync(ModifyPushConfigRequest, CallOptions)

public virtual AsyncUnaryCall<Empty> ModifyPushConfigAsync(ModifyPushConfigRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

ModifyPushConfigAsync(ModifyPushConfigRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Empty> ModifyPushConfigAsync(ModifyPushConfigRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallEmpty

The call object.

NewInstance(ClientBaseConfiguration)

protected override Subscriber.SubscriberClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given ClientBaseConfiguration.

Parameter
Name Description
configuration ClientBaseClientBaseConfiguration
Returns
Type Description
SubscriberSubscriberClient
Overrides
Grpc.Core.ClientBase<Google.Cloud.PubSub.V1.Subscriber.SubscriberClient>.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)

Pull(PullRequest, CallOptions)

public virtual PullResponse Pull(PullRequest request, CallOptions options)

Pulls messages from the server.

Parameters
Name Description
request PullRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
PullResponse

The response received from the server.

Pull(PullRequest, Metadata, DateTime?, CancellationToken)

public virtual PullResponse Pull(PullRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Pulls messages from the server.

Parameters
Name Description
request PullRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
PullResponse

The response received from the server.

PullAsync(PullRequest, CallOptions)

public virtual AsyncUnaryCall<PullResponse> PullAsync(PullRequest request, CallOptions options)

Pulls messages from the server.

Parameters
Name Description
request PullRequest

The request to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallPullResponse

The call object.

PullAsync(PullRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<PullResponse> PullAsync(PullRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Pulls messages from the server.

Parameters
Name Description
request PullRequest

The request to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallPullResponse

The call object.

Seek(SeekRequest, CallOptions)

public virtual SeekResponse Seek(SeekRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
SeekResponse

The response received from the server.

Seek(SeekRequest, Metadata, DateTime?, CancellationToken)

public virtual SeekResponse Seek(SeekRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
SeekResponse

The response received from the server.

SeekAsync(SeekRequest, CallOptions)

public virtual AsyncUnaryCall<SeekResponse> SeekAsync(SeekRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallSeekResponse

The call object.

SeekAsync(SeekRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<SeekResponse> SeekAsync(SeekRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallSeekResponse

The call object.

StreamingPull(CallOptions)

public virtual AsyncDuplexStreamingCall<StreamingPullRequest, StreamingPullResponse> StreamingPull(CallOptions options)

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.

Parameter
Name Description
options CallOptions

The options for the call.

Returns
Type Description
AsyncDuplexStreamingCallStreamingPullRequestStreamingPullResponse

The call object.

StreamingPull(Metadata, DateTime?, CancellationToken)

public virtual AsyncDuplexStreamingCall<StreamingPullRequest, StreamingPullResponse> StreamingPull(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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
headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncDuplexStreamingCallStreamingPullRequestStreamingPullResponse

The call object.

UpdateSnapshot(UpdateSnapshotRequest, CallOptions)

public virtual Snapshot UpdateSnapshot(UpdateSnapshotRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Snapshot

The response received from the server.

UpdateSnapshot(UpdateSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual Snapshot UpdateSnapshot(UpdateSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Snapshot

The response received from the server.

UpdateSnapshotAsync(UpdateSnapshotRequest, CallOptions)

public virtual AsyncUnaryCall<Snapshot> UpdateSnapshotAsync(UpdateSnapshotRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallSnapshot

The call object.

UpdateSnapshotAsync(UpdateSnapshotRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Snapshot> UpdateSnapshotAsync(UpdateSnapshotRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallSnapshot

The call object.

UpdateSubscription(UpdateSubscriptionRequest, CallOptions)

public virtual Subscription UpdateSubscription(UpdateSubscriptionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
Subscription

The response received from the server.

UpdateSubscription(UpdateSubscriptionRequest, Metadata, DateTime?, CancellationToken)

public virtual Subscription UpdateSubscription(UpdateSubscriptionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
Subscription

The response received from the server.

UpdateSubscriptionAsync(UpdateSubscriptionRequest, CallOptions)

public virtual AsyncUnaryCall<Subscription> UpdateSubscriptionAsync(UpdateSubscriptionRequest request, CallOptions options)

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 to send to the server.

options CallOptions

The options for the call.

Returns
Type Description
AsyncUnaryCallSubscription

The call object.

UpdateSubscriptionAsync(UpdateSubscriptionRequest, Metadata, DateTime?, CancellationToken)

public virtual AsyncUnaryCall<Subscription> UpdateSubscriptionAsync(UpdateSubscriptionRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server.

headers Metadata

The initial metadata to send with the call. This parameter is optional.

deadline System.DateTime

An optional deadline for the call. The call will be cancelled if deadline is hit.

cancellationToken CancellationToken

An optional token for canceling the call.

Returns
Type Description
AsyncUnaryCallSubscription

The call object.