public abstract class SubscriberServiceApiClient
Reference documentation and code samples for the Cloud Pub/Sub v1 API class SubscriberServiceApiClient.
SubscriberServiceApi client wrapper, for convenient use.
Derived Types
Namespace
GoogleGoogle.CloudGoogle.Cloud.PubSubV1Assembly
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.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the SubscriberServiceApi service, which is a host of "pubsub.googleapis.com" and a port of 443.
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default SubscriberServiceApi scopes.
Type | Description |
IReadOnlyListstring |
The default SubscriberServiceApi scopes are:
GrpcClient
public virtual Subscriber.SubscriberClient GrpcClient { get; }
The underlying gRPC SubscriberServiceApi client
Type | Description |
SubscriberSubscriberClient |
IAMPolicyClient
public virtual IAMPolicyClient IAMPolicyClient { get; }
The IAMPolicyClient associated with this client.
Type | Description |
IAMPolicyClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Type | Description |
ServiceMetadata |
Methods
Acknowledge(AcknowledgeRequest, CallSettings)
public virtual 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.
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. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = SubscriberServiceApiClient.Create();
// Initialize request argument(s)
AcknowledgeRequest request = new AcknowledgeRequest
{
SubscriptionAsSubscriptionName = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]"),
AckIds = { "", },
};
// Make the request
subscriberServiceApiClient.Acknowledge(request);
Acknowledge(SubscriptionName, IEnumerable<string>, CallSettings)
public virtual void Acknowledge(SubscriptionName subscription, IEnumerable<string> ackIds, 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.
Name | Description |
subscription | SubscriptionName Required. The subscription whose message is being acknowledged.
Format is |
ackIds | IEnumerablestring Required. The acknowledgment ID for the messages being acknowledged that
was returned by the Pub/Sub system in the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = SubscriberServiceApiClient.Create();
// Initialize request argument(s)
SubscriptionName subscription = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]");
IEnumerable<string> ackIds = new string[] { "", };
// Make the request
subscriberServiceApiClient.Acknowledge(subscription, ackIds);
Acknowledge(string, IEnumerable<string>, CallSettings)
public virtual void Acknowledge(string subscription, IEnumerable<string> ackIds, 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.
Name | Description |
subscription | string Required. The subscription whose message is being acknowledged.
Format is |
ackIds | IEnumerablestring Required. The acknowledgment ID for the messages being acknowledged that
was returned by the Pub/Sub system in the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = SubscriberServiceApiClient.Create();
// Initialize request argument(s)
string subscription = "projects/[PROJECT]/subscriptions/[SUBSCRIPTION]";
IEnumerable<string> ackIds = new string[] { "", };
// Make the request
subscriberServiceApiClient.Acknowledge(subscription, ackIds);
AcknowledgeAsync(AcknowledgeRequest, CallSettings)
public virtual 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.
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. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
AcknowledgeRequest request = new AcknowledgeRequest
{
SubscriptionAsSubscriptionName = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]"),
AckIds = { "", },
};
// Make the request
await subscriberServiceApiClient.AcknowledgeAsync(request);
AcknowledgeAsync(AcknowledgeRequest, CancellationToken)
public virtual Task AcknowledgeAsync(AcknowledgeRequest request, CancellationToken cancellationToken)
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.
Name | Description |
request | AcknowledgeRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
AcknowledgeRequest request = new AcknowledgeRequest
{
SubscriptionAsSubscriptionName = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]"),
AckIds = { "", },
};
// Make the request
await subscriberServiceApiClient.AcknowledgeAsync(request);
AcknowledgeAsync(SubscriptionName, IEnumerable<string>, CallSettings)
public virtual Task AcknowledgeAsync(SubscriptionName subscription, IEnumerable<string> ackIds, 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.
Name | Description |
subscription | SubscriptionName Required. The subscription whose message is being acknowledged.
Format is |
ackIds | IEnumerablestring Required. The acknowledgment ID for the messages being acknowledged that
was returned by the Pub/Sub system in the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
SubscriptionName subscription = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]");
IEnumerable<string> ackIds = new string[] { "", };
// Make the request
await subscriberServiceApiClient.AcknowledgeAsync(subscription, ackIds);
AcknowledgeAsync(SubscriptionName, IEnumerable<string>, CancellationToken)
public virtual Task AcknowledgeAsync(SubscriptionName subscription, IEnumerable<string> ackIds, CancellationToken cancellationToken)
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.
Name | Description |
subscription | SubscriptionName Required. The subscription whose message is being acknowledged.
Format is |
ackIds | IEnumerablestring Required. The acknowledgment ID for the messages being acknowledged that
was returned by the Pub/Sub system in the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
SubscriptionName subscription = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]");
IEnumerable<string> ackIds = new string[] { "", };
// Make the request
await subscriberServiceApiClient.AcknowledgeAsync(subscription, ackIds);
AcknowledgeAsync(string, IEnumerable<string>, CallSettings)
public virtual Task AcknowledgeAsync(string subscription, IEnumerable<string> ackIds, 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.
Name | Description |
subscription | string Required. The subscription whose message is being acknowledged.
Format is |
ackIds | IEnumerablestring Required. The acknowledgment ID for the messages being acknowledged that
was returned by the Pub/Sub system in the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
string subscription = "projects/[PROJECT]/subscriptions/[SUBSCRIPTION]";
IEnumerable<string> ackIds = new string[] { "", };
// Make the request
await subscriberServiceApiClient.AcknowledgeAsync(subscription, ackIds);
AcknowledgeAsync(string, IEnumerable<string>, CancellationToken)
public virtual Task AcknowledgeAsync(string subscription, IEnumerable<string> ackIds, CancellationToken cancellationToken)
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.
Name | Description |
subscription | string Required. The subscription whose message is being acknowledged.
Format is |
ackIds | IEnumerablestring Required. The acknowledgment ID for the messages being acknowledged that
was returned by the Pub/Sub system in the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
string subscription = "projects/[PROJECT]/subscriptions/[SUBSCRIPTION]";
IEnumerable<string> ackIds = new string[] { "", };
// Make the request
await subscriberServiceApiClient.AcknowledgeAsync(subscription, ackIds);
Create()
public static SubscriberServiceApiClient Create()
Synchronously creates a SubscriberServiceApiClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SubscriberServiceApiClientBuilder.
Type | Description |
SubscriberServiceApiClient | The created SubscriberServiceApiClient. |
CreateAsync(CancellationToken)
public static Task<SubscriberServiceApiClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a SubscriberServiceApiClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SubscriberServiceApiClientBuilder.
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Type | Description |
TaskSubscriberServiceApiClient | The task representing the created SubscriberServiceApiClient. |
CreateSnapshot(CreateSnapshotRequest, CallSettings)
public virtual 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.
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. |
Type | Description |
Snapshot | The RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = SubscriberServiceApiClient.Create();
// Initialize request argument(s)
CreateSnapshotRequest request = new CreateSnapshotRequest
{
SnapshotName = SnapshotName.FromProjectSnapshot("[PROJECT]", "[SNAPSHOT]"),
SubscriptionAsSubscriptionName = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]"),
Labels = { { "", "" }, },
};
// Make the request
Snapshot response = subscriberServiceApiClient.CreateSnapshot(request);
CreateSnapshot(SnapshotName, SubscriptionName, CallSettings)
public virtual Snapshot CreateSnapshot(SnapshotName name, SubscriptionName subscription, 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.
Name | Description |
name | SnapshotName Required. User-provided name for this snapshot. If the name is not provided
in the request, the server will assign a random name for this snapshot on
the same project as the subscription. Note that for REST API requests, you
must specify a name. See the resource name
rules. Format
is |
subscription | SubscriptionName Required. The subscription whose backlog the snapshot retains.
Specifically, the created snapshot is guaranteed to retain:
(a) The existing backlog on the subscription. More precisely, this is
defined as the messages in the subscription's backlog that are
unacknowledged upon the successful completion of the
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Snapshot | The RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = SubscriberServiceApiClient.Create();
// Initialize request argument(s)
SnapshotName name = SnapshotName.FromProjectSnapshot("[PROJECT]", "[SNAPSHOT]");
SubscriptionName subscription = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]");
// Make the request
Snapshot response = subscriberServiceApiClient.CreateSnapshot(name, subscription);
CreateSnapshot(string, string, CallSettings)
public virtual Snapshot CreateSnapshot(string name, string subscription, 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.
Name | Description |
name | string Required. User-provided name for this snapshot. If the name is not provided
in the request, the server will assign a random name for this snapshot on
the same project as the subscription. Note that for REST API requests, you
must specify a name. See the resource name
rules. Format
is |
subscription | string Required. The subscription whose backlog the snapshot retains.
Specifically, the created snapshot is guaranteed to retain:
(a) The existing backlog on the subscription. More precisely, this is
defined as the messages in the subscription's backlog that are
unacknowledged upon the successful completion of the
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Snapshot | The RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = SubscriberServiceApiClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/snapshots/[SNAPSHOT]";
string subscription = "projects/[PROJECT]/subscriptions/[SUBSCRIPTION]";
// Make the request
Snapshot response = subscriberServiceApiClient.CreateSnapshot(name, subscription);
CreateSnapshotAsync(CreateSnapshotRequest, CallSettings)
public virtual 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.
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. |
Type | Description |
TaskSnapshot | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
CreateSnapshotRequest request = new CreateSnapshotRequest
{
SnapshotName = SnapshotName.FromProjectSnapshot("[PROJECT]", "[SNAPSHOT]"),
SubscriptionAsSubscriptionName = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]"),
Labels = { { "", "" }, },
};
// Make the request
Snapshot response = await subscriberServiceApiClient.CreateSnapshotAsync(request);
CreateSnapshotAsync(CreateSnapshotRequest, CancellationToken)
public virtual Task<Snapshot> CreateSnapshotAsync(CreateSnapshotRequest request, CancellationToken cancellationToken)
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.
Name | Description |
request | CreateSnapshotRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskSnapshot | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
CreateSnapshotRequest request = new CreateSnapshotRequest
{
SnapshotName = SnapshotName.FromProjectSnapshot("[PROJECT]", "[SNAPSHOT]"),
SubscriptionAsSubscriptionName = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]"),
Labels = { { "", "" }, },
};
// Make the request
Snapshot response = await subscriberServiceApiClient.CreateSnapshotAsync(request);
CreateSnapshotAsync(SnapshotName, SubscriptionName, CallSettings)
public virtual Task<Snapshot> CreateSnapshotAsync(SnapshotName name, SubscriptionName subscription, 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.
Name | Description |
name | SnapshotName Required. User-provided name for this snapshot. If the name is not provided
in the request, the server will assign a random name for this snapshot on
the same project as the subscription. Note that for REST API requests, you
must specify a name. See the resource name
rules. Format
is |
subscription | SubscriptionName Required. The subscription whose backlog the snapshot retains.
Specifically, the created snapshot is guaranteed to retain:
(a) The existing backlog on the subscription. More precisely, this is
defined as the messages in the subscription's backlog that are
unacknowledged upon the successful completion of the
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskSnapshot | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
SnapshotName name = SnapshotName.FromProjectSnapshot("[PROJECT]", "[SNAPSHOT]");
SubscriptionName subscription = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]");
// Make the request
Snapshot response = await subscriberServiceApiClient.CreateSnapshotAsync(name, subscription);
CreateSnapshotAsync(SnapshotName, SubscriptionName, CancellationToken)
public virtual Task<Snapshot> CreateSnapshotAsync(SnapshotName name, SubscriptionName subscription, CancellationToken cancellationToken)
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.
Name | Description |
name | SnapshotName Required. User-provided name for this snapshot. If the name is not provided
in the request, the server will assign a random name for this snapshot on
the same project as the subscription. Note that for REST API requests, you
must specify a name. See the resource name
rules. Format
is |
subscription | SubscriptionName Required. The subscription whose backlog the snapshot retains.
Specifically, the created snapshot is guaranteed to retain:
(a) The existing backlog on the subscription. More precisely, this is
defined as the messages in the subscription's backlog that are
unacknowledged upon the successful completion of the
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskSnapshot | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
SnapshotName name = SnapshotName.FromProjectSnapshot("[PROJECT]", "[SNAPSHOT]");
SubscriptionName subscription = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]");
// Make the request
Snapshot response = await subscriberServiceApiClient.CreateSnapshotAsync(name, subscription);
CreateSnapshotAsync(string, string, CallSettings)
public virtual Task<Snapshot> CreateSnapshotAsync(string name, string subscription, 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.
Name | Description |
name | string Required. User-provided name for this snapshot. If the name is not provided
in the request, the server will assign a random name for this snapshot on
the same project as the subscription. Note that for REST API requests, you
must specify a name. See the resource name
rules. Format
is |
subscription | string Required. The subscription whose backlog the snapshot retains.
Specifically, the created snapshot is guaranteed to retain:
(a) The existing backlog on the subscription. More precisely, this is
defined as the messages in the subscription's backlog that are
unacknowledged upon the successful completion of the
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskSnapshot | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/snapshots/[SNAPSHOT]";
string subscription = "projects/[PROJECT]/subscriptions/[SUBSCRIPTION]";
// Make the request
Snapshot response = await subscriberServiceApiClient.CreateSnapshotAsync(name, subscription);
CreateSnapshotAsync(string, string, CancellationToken)
public virtual Task<Snapshot> CreateSnapshotAsync(string name, string subscription, CancellationToken cancellationToken)
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.
Name | Description |
name | string Required. User-provided name for this snapshot. If the name is not provided
in the request, the server will assign a random name for this snapshot on
the same project as the subscription. Note that for REST API requests, you
must specify a name. See the resource name
rules. Format
is |
subscription | string Required. The subscription whose backlog the snapshot retains.
Specifically, the created snapshot is guaranteed to retain:
(a) The existing backlog on the subscription. More precisely, this is
defined as the messages in the subscription's backlog that are
unacknowledged upon the successful completion of the
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskSnapshot | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/snapshots/[SNAPSHOT]";
string subscription = "projects/[PROJECT]/subscriptions/[SUBSCRIPTION]";
// Make the request
Snapshot response = await subscriberServiceApiClient.CreateSnapshotAsync(name, subscription);
CreateSubscription(Subscription, CallSettings)
public virtual 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.
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. |
Type | Description |
Subscription | The RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = SubscriberServiceApiClient.Create();
// Initialize request argument(s)
Subscription request = new Subscription
{
SubscriptionName = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]"),
TopicAsTopicName = TopicName.FromProjectTopic("[PROJECT]", "[TOPIC]"),
PushConfig = new PushConfig(),
AckDeadlineSeconds = 0,
RetainAckedMessages = false,
MessageRetentionDuration = new Duration(),
Labels = { { "", "" }, },
EnableMessageOrdering = false,
ExpirationPolicy = new ExpirationPolicy(),
Filter = "",
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
EnableExactlyOnceDelivery = false,
TopicMessageRetentionDuration = new Duration(),
BigqueryConfig = new BigQueryConfig(),
State = Subscription.Types.State.Unspecified,
};
// Make the request
Subscription response = subscriberServiceApiClient.CreateSubscription(request);
CreateSubscription(SubscriptionName, TopicName, PushConfig, int, CallSettings)
public virtual Subscription CreateSubscription(SubscriptionName name, TopicName topic, PushConfig pushConfig, int ackDeadlineSeconds, 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.
Name | Description |
name | SubscriptionName Required. The name of the subscription. It must have the format
|
topic | TopicName Required. The name of the topic from which this subscription is receiving
messages. Format is |
pushConfig | PushConfig If push delivery is used with this subscription, this field is used to configure it. |
ackDeadlineSeconds | int The approximate amount of time (on a best-effort basis) Pub/Sub waits for the subscriber to acknowledge receipt before resending the message. In the interval after the message is delivered and before it is acknowledged, it is considered to be outstanding. During that time period, the message will not be redelivered (on a best-effort basis). For pull subscriptions, this value is used as the initial value for the ack
deadline. To override this value for a given message, call
For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Subscription | The RPC response. |
SubscriberServiceApiClient client = SubscriberServiceApiClient.Create();
SubscriptionName subscriptionName = new SubscriptionName(projectId, subscriptionId);
TopicName topicName = new TopicName(projectId, topicId);
Subscription subscription = client.CreateSubscription(
subscriptionName, topicName, pushConfig: null, ackDeadlineSeconds: 30);
Console.WriteLine($"Created {subscription.Name} subscribed to {subscription.Topic}");
CreateSubscription(string, string, PushConfig, int, CallSettings)
public virtual Subscription CreateSubscription(string name, string topic, PushConfig pushConfig, int ackDeadlineSeconds, 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.
Name | Description |
name | string Required. The name of the subscription. It must have the format
|
topic | string Required. The name of the topic from which this subscription is receiving
messages. Format is |
pushConfig | PushConfig If push delivery is used with this subscription, this field is used to configure it. |
ackDeadlineSeconds | int The approximate amount of time (on a best-effort basis) Pub/Sub waits for the subscriber to acknowledge receipt before resending the message. In the interval after the message is delivered and before it is acknowledged, it is considered to be outstanding. During that time period, the message will not be redelivered (on a best-effort basis). For pull subscriptions, this value is used as the initial value for the ack
deadline. To override this value for a given message, call
For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Subscription | The RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = SubscriberServiceApiClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/subscriptions/[SUBSCRIPTION]";
string topic = "projects/[PROJECT]/topics/[TOPIC]";
PushConfig pushConfig = new PushConfig();
int ackDeadlineSeconds = 0;
// Make the request
Subscription response = subscriberServiceApiClient.CreateSubscription(name, topic, pushConfig, ackDeadlineSeconds);
CreateSubscriptionAsync(Subscription, CallSettings)
public virtual 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.
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. |
Type | Description |
TaskSubscription | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
Subscription request = new Subscription
{
SubscriptionName = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]"),
TopicAsTopicName = TopicName.FromProjectTopic("[PROJECT]", "[TOPIC]"),
PushConfig = new PushConfig(),
AckDeadlineSeconds = 0,
RetainAckedMessages = false,
MessageRetentionDuration = new Duration(),
Labels = { { "", "" }, },
EnableMessageOrdering = false,
ExpirationPolicy = new ExpirationPolicy(),
Filter = "",
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
EnableExactlyOnceDelivery = false,
TopicMessageRetentionDuration = new Duration(),
BigqueryConfig = new BigQueryConfig(),
State = Subscription.Types.State.Unspecified,
};
// Make the request
Subscription response = await subscriberServiceApiClient.CreateSubscriptionAsync(request);
CreateSubscriptionAsync(Subscription, CancellationToken)
public virtual Task<Subscription> CreateSubscriptionAsync(Subscription request, CancellationToken cancellationToken)
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.
Name | Description |
request | Subscription The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskSubscription | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
Subscription request = new Subscription
{
SubscriptionName = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]"),
TopicAsTopicName = TopicName.FromProjectTopic("[PROJECT]", "[TOPIC]"),
PushConfig = new PushConfig(),
AckDeadlineSeconds = 0,
RetainAckedMessages = false,
MessageRetentionDuration = new Duration(),
Labels = { { "", "" }, },
EnableMessageOrdering = false,
ExpirationPolicy = new ExpirationPolicy(),
Filter = "",
DeadLetterPolicy = new DeadLetterPolicy(),
RetryPolicy = new RetryPolicy(),
Detached = false,
EnableExactlyOnceDelivery = false,
TopicMessageRetentionDuration = new Duration(),
BigqueryConfig = new BigQueryConfig(),
State = Subscription.Types.State.Unspecified,
};
// Make the request
Subscription response = await subscriberServiceApiClient.CreateSubscriptionAsync(request);
CreateSubscriptionAsync(SubscriptionName, TopicName, PushConfig, int, CallSettings)
public virtual Task<Subscription> CreateSubscriptionAsync(SubscriptionName name, TopicName topic, PushConfig pushConfig, int ackDeadlineSeconds, 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.
Name | Description |
name | SubscriptionName Required. The name of the subscription. It must have the format
|
topic | TopicName Required. The name of the topic from which this subscription is receiving
messages. Format is |
pushConfig | PushConfig If push delivery is used with this subscription, this field is used to configure it. |
ackDeadlineSeconds | int The approximate amount of time (on a best-effort basis) Pub/Sub waits for the subscriber to acknowledge receipt before resending the message. In the interval after the message is delivered and before it is acknowledged, it is considered to be outstanding. During that time period, the message will not be redelivered (on a best-effort basis). For pull subscriptions, this value is used as the initial value for the ack
deadline. To override this value for a given message, call
For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskSubscription | A Task containing the RPC response. |
SubscriberServiceApiClient client = SubscriberServiceApiClient.Create();
SubscriptionName subscriptionName = new SubscriptionName(projectId, subscriptionId);
TopicName topicName = new TopicName(projectId, topicId);
Subscription subscription = await client.CreateSubscriptionAsync(
subscriptionName, topicName, pushConfig: null, ackDeadlineSeconds: 30);
Console.WriteLine($"Created {subscription.Name} subscribed to {subscription.Topic}");
CreateSubscriptionAsync(SubscriptionName, TopicName, PushConfig, int, CancellationToken)
public virtual Task<Subscription> CreateSubscriptionAsync(SubscriptionName name, TopicName topic, PushConfig pushConfig, int ackDeadlineSeconds, CancellationToken cancellationToken)
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.
Name | Description |
name | SubscriptionName Required. The name of the subscription. It must have the format
|
topic | TopicName Required. The name of the topic from which this subscription is receiving
messages. Format is |
pushConfig | PushConfig If push delivery is used with this subscription, this field is used to configure it. |
ackDeadlineSeconds | int The approximate amount of time (on a best-effort basis) Pub/Sub waits for the subscriber to acknowledge receipt before resending the message. In the interval after the message is delivered and before it is acknowledged, it is considered to be outstanding. During that time period, the message will not be redelivered (on a best-effort basis). For pull subscriptions, this value is used as the initial value for the ack
deadline. To override this value for a given message, call
For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskSubscription | A Task containing the RPC response. |
SubscriberServiceApiClient client = SubscriberServiceApiClient.Create();
SubscriptionName subscriptionName = new SubscriptionName(projectId, subscriptionId);
TopicName topicName = new TopicName(projectId, topicId);
Subscription subscription = await client.CreateSubscriptionAsync(
subscriptionName, topicName, pushConfig: null, ackDeadlineSeconds: 30);
Console.WriteLine($"Created {subscription.Name} subscribed to {subscription.Topic}");
CreateSubscriptionAsync(string, string, PushConfig, int, CallSettings)
public virtual Task<Subscription> CreateSubscriptionAsync(string name, string topic, PushConfig pushConfig, int ackDeadlineSeconds, 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.
Name | Description |
name | string Required. The name of the subscription. It must have the format
|
topic | string Required. The name of the topic from which this subscription is receiving
messages. Format is |
pushConfig | PushConfig If push delivery is used with this subscription, this field is used to configure it. |
ackDeadlineSeconds | int The approximate amount of time (on a best-effort basis) Pub/Sub waits for the subscriber to acknowledge receipt before resending the message. In the interval after the message is delivered and before it is acknowledged, it is considered to be outstanding. During that time period, the message will not be redelivered (on a best-effort basis). For pull subscriptions, this value is used as the initial value for the ack
deadline. To override this value for a given message, call
For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
TaskSubscription | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/subscriptions/[SUBSCRIPTION]";
string topic = "projects/[PROJECT]/topics/[TOPIC]";
PushConfig pushConfig = new PushConfig();
int ackDeadlineSeconds = 0;
// Make the request
Subscription response = await subscriberServiceApiClient.CreateSubscriptionAsync(name, topic, pushConfig, ackDeadlineSeconds);
CreateSubscriptionAsync(string, string, PushConfig, int, CancellationToken)
public virtual Task<Subscription> CreateSubscriptionAsync(string name, string topic, PushConfig pushConfig, int ackDeadlineSeconds, CancellationToken cancellationToken)
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.
Name | Description |
name | string Required. The name of the subscription. It must have the format
|
topic | string Required. The name of the topic from which this subscription is receiving
messages. Format is |
pushConfig | PushConfig If push delivery is used with this subscription, this field is used to configure it. |
ackDeadlineSeconds | int The approximate amount of time (on a best-effort basis) Pub/Sub waits for the subscriber to acknowledge receipt before resending the message. In the interval after the message is delivered and before it is acknowledged, it is considered to be outstanding. During that time period, the message will not be redelivered (on a best-effort basis). For pull subscriptions, this value is used as the initial value for the ack
deadline. To override this value for a given message, call
For push delivery, this value is also used to set the request timeout for the call to the push endpoint. If the subscriber never acknowledges the message, the Pub/Sub system will eventually redeliver the message. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
TaskSubscription | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/subscriptions/[SUBSCRIPTION]";
string topic = "projects/[PROJECT]/topics/[TOPIC]";
PushConfig pushConfig = new PushConfig();
int ackDeadlineSeconds = 0;
// Make the request
Subscription response = await subscriberServiceApiClient.CreateSubscriptionAsync(name, topic, pushConfig, ackDeadlineSeconds);
DeleteSnapshot(DeleteSnapshotRequest, CallSettings)
public virtual 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.
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. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = SubscriberServiceApiClient.Create();
// Initialize request argument(s)
DeleteSnapshotRequest request = new DeleteSnapshotRequest
{
SnapshotAsSnapshotName = SnapshotName.FromProjectSnapshot("[PROJECT]", "[SNAPSHOT]"),
};
// Make the request
subscriberServiceApiClient.DeleteSnapshot(request);
DeleteSnapshot(SnapshotName, CallSettings)
public virtual void DeleteSnapshot(SnapshotName snapshot, 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.
Name | Description |
snapshot | SnapshotName Required. The name of the snapshot to delete.
Format is |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = SubscriberServiceApiClient.Create();
// Initialize request argument(s)
SnapshotName snapshot = SnapshotName.FromProjectSnapshot("[PROJECT]", "[SNAPSHOT]");
// Make the request
subscriberServiceApiClient.DeleteSnapshot(snapshot);
DeleteSnapshot(string, CallSettings)
public virtual void DeleteSnapshot(string snapshot, 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.
Name | Description |
snapshot | string Required. The name of the snapshot to delete.
Format is |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = SubscriberServiceApiClient.Create();
// Initialize request argument(s)
string snapshot = "projects/[PROJECT]/snapshots/[SNAPSHOT]";
// Make the request
subscriberServiceApiClient.DeleteSnapshot(snapshot);
DeleteSnapshotAsync(DeleteSnapshotRequest, CallSettings)
public virtual 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.
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. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
DeleteSnapshotRequest request = new DeleteSnapshotRequest
{
SnapshotAsSnapshotName = SnapshotName.FromProjectSnapshot("[PROJECT]", "[SNAPSHOT]"),
};
// Make the request
await subscriberServiceApiClient.DeleteSnapshotAsync(request);
DeleteSnapshotAsync(DeleteSnapshotRequest, CancellationToken)
public virtual Task DeleteSnapshotAsync(DeleteSnapshotRequest request, CancellationToken cancellationToken)
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.
Name | Description |
request | DeleteSnapshotRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
DeleteSnapshotRequest request = new DeleteSnapshotRequest
{
SnapshotAsSnapshotName = SnapshotName.FromProjectSnapshot("[PROJECT]", "[SNAPSHOT]"),
};
// Make the request
await subscriberServiceApiClient.DeleteSnapshotAsync(request);
DeleteSnapshotAsync(SnapshotName, CallSettings)
public virtual Task DeleteSnapshotAsync(SnapshotName snapshot, 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.
Name | Description |
snapshot | SnapshotName Required. The name of the snapshot to delete.
Format is |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
SnapshotName snapshot = SnapshotName.FromProjectSnapshot("[PROJECT]", "[SNAPSHOT]");
// Make the request
await subscriberServiceApiClient.DeleteSnapshotAsync(snapshot);
DeleteSnapshotAsync(SnapshotName, CancellationToken)
public virtual Task DeleteSnapshotAsync(SnapshotName snapshot, CancellationToken cancellationToken)
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.
Name | Description |
snapshot | SnapshotName Required. The name of the snapshot to delete.
Format is |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
SnapshotName snapshot = SnapshotName.FromProjectSnapshot("[PROJECT]", "[SNAPSHOT]");
// Make the request
await subscriberServiceApiClient.DeleteSnapshotAsync(snapshot);
DeleteSnapshotAsync(string, CallSettings)
public virtual Task DeleteSnapshotAsync(string snapshot, 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.
Name | Description |
snapshot | string Required. The name of the snapshot to delete.
Format is |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
string snapshot = "projects/[PROJECT]/snapshots/[SNAPSHOT]";
// Make the request
await subscriberServiceApiClient.DeleteSnapshotAsync(snapshot);
DeleteSnapshotAsync(string, CancellationToken)
public virtual Task DeleteSnapshotAsync(string snapshot, CancellationToken cancellationToken)
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.
Name | Description |
snapshot | string Required. The name of the snapshot to delete.
Format is |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Type | Description |
Task | A Task containing the RPC response. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
// Initialize request argument(s)
string snapshot = "projects/[PROJECT]/snapshots/[SNAPSHOT]";
// Make the request
await subscriberServiceApiClient.DeleteSnapshotAsync(snapshot);
DeleteSubscription(DeleteSubscriptionRequest, CallSettings)
public virtual 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.
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. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = SubscriberServiceApiClient.Create();
// Initialize request argument(s)
DeleteSubscriptionRequest request = new DeleteSubscriptionRequest
{
SubscriptionAsSubscriptionName = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]"),
};
// Make the request
subscriberServiceApiClient.DeleteSubscription(request);
DeleteSubscription(SubscriptionName, CallSettings)
public virtual void DeleteSubscription(SubscriptionName subscription, 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.
Name | Description |
subscription | SubscriptionName Required. The subscription to delete.
Format is |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
SubscriberServiceApiClient subscriberServiceApiClient = SubscriberServiceApiClient.Create();
// Initialize request argument(s)
SubscriptionName subscription = SubscriptionName.FromProjectSubscription("[PROJECT]", "[SUBSCRIPTION]");
// Make the request
subscriberServiceApiClient.DeleteSubscription(subscription);
DeleteSubscription(string, CallSettings)