Class v1.SubscriberClient (2.18.3)

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

Package

@google-cloud/pubsub

Constructors

(constructor)(opts)

constructor(opts?: ClientOptions);

Construct an instance of SubscriberClient.

Parameter
NameDescription
opts ClientOptions

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

Property Value
TypeDescription
string

auth

auth: gax.GoogleAuth;
Property Value
TypeDescription
gax.GoogleAuth

descriptors

descriptors: Descriptors;
Property Value
TypeDescription
Descriptors

iamClient

iamClient: IamClient;
Property Value
TypeDescription
IamClient

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };
Property Value
TypeDescription
{ [name: string]: Function; }

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };
Property Value
TypeDescription
{ [name: string]: gax.PathTemplate; }

port

static get port(): number;

The port for this API service.

Property Value
TypeDescription
number

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

Property Value
TypeDescription
string[]

servicePath

static get servicePath(): string;

The DNS address for this API service.

Property Value
TypeDescription
string

subscriberStub

subscriberStub?: Promise<{
        [name: string]: Function;
    }>;
Property Value
TypeDescription
Promise<{ [name: string]: Function; }>

warn

warn: (code: string, message: string, warnType?: string) => void;
Property Value
TypeDescription
(code: string, message: string, warnType?: string) => void

Methods

acknowledge(request, options)

acknowledge(request?: protos.google.pubsub.v1.IAcknowledgeRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IAcknowledgeRequest | undefined, {} | undefined]>;

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
NameDescription
request protos.google.pubsub.v1.IAcknowledgeRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IAcknowledgeRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

include:samples/generated/v1/subscriber.acknowledge.js region_tag:pubsub_v1_generated_Subscriber_Acknowledge_async

acknowledge(request, options, callback)

acknowledge(request: protos.google.pubsub.v1.IAcknowledgeRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IAcknowledgeRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

acknowledge(request, callback)

acknowledge(request: protos.google.pubsub.v1.IAcknowledgeRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IAcknowledgeRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IAcknowledgeRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

createSnapshot(request, options)

createSnapshot(request?: protos.google.pubsub.v1.ICreateSnapshotRequest, options?: CallOptions): Promise<[protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.ICreateSnapshotRequest | undefined, {} | undefined]>;

Creates a snapshot from the requested subscription. Snapshots are used in [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. If the snapshot already exists, returns ALREADY_EXISTS. If the requested subscription doesn't exist, returns NOT_FOUND. If the backlog in the subscription is too old -- and the resulting snapshot would expire in less than 1 hour -- then FAILED_PRECONDITION is returned. See also the Snapshot.expire_time field. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request.

Parameters
NameDescription
request protos.google.pubsub.v1.ICreateSnapshotRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.ICreateSnapshotRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Snapshot]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

include:samples/generated/v1/subscriber.create_snapshot.js region_tag:pubsub_v1_generated_Subscriber_CreateSnapshot_async

createSnapshot(request, options, callback)

createSnapshot(request: protos.google.pubsub.v1.ICreateSnapshotRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.ICreateSnapshotRequest
options CallOptions
callback Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createSnapshot(request, callback)

createSnapshot(request: protos.google.pubsub.v1.ICreateSnapshotRequest, callback: Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.ICreateSnapshotRequest
callback Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.ICreateSnapshotRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createSubscription(request, options)

createSubscription(request?: protos.google.pubsub.v1.ISubscription, options?: CallOptions): Promise<[protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.ISubscription | undefined, {} | undefined]>;

Creates a subscription to a given topic. See the [resource name rules] (https://cloud.google.com/pubsub/docs/admin#resource_names). If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND.

If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/admin#resource_names). The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.

Parameters
NameDescription
request protos.google.pubsub.v1.ISubscription

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.ISubscription | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Subscription]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

include:samples/generated/v1/subscriber.create_subscription.js region_tag:pubsub_v1_generated_Subscriber_CreateSubscription_async

createSubscription(request, options, callback)

createSubscription(request: protos.google.pubsub.v1.ISubscription, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.ISubscription | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.ISubscription
options CallOptions
callback Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.ISubscription | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createSubscription(request, callback)

createSubscription(request: protos.google.pubsub.v1.ISubscription, callback: Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.ISubscription | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.ISubscription
callback Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.ISubscription | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteSnapshot(request, options)

deleteSnapshot(request?: protos.google.pubsub.v1.IDeleteSnapshotRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSnapshotRequest | undefined, {} | undefined]>;

Removes an existing snapshot. Snapshots are used in [Seek] (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. When the snapshot is deleted, all messages retained in the snapshot are immediately dropped. After a snapshot is deleted, a new one may be created with the same name, but the new one has no association with the old snapshot or its subscription, unless the same subscription is specified.

Parameters
NameDescription
request protos.google.pubsub.v1.IDeleteSnapshotRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSnapshotRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

include:samples/generated/v1/subscriber.delete_snapshot.js region_tag:pubsub_v1_generated_Subscriber_DeleteSnapshot_async

deleteSnapshot(request, options, callback)

deleteSnapshot(request: protos.google.pubsub.v1.IDeleteSnapshotRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IDeleteSnapshotRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteSnapshot(request, callback)

deleteSnapshot(request: protos.google.pubsub.v1.IDeleteSnapshotRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IDeleteSnapshotRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSnapshotRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteSubscription(request, options)

deleteSubscription(request?: protos.google.pubsub.v1.IDeleteSubscriptionRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSubscriptionRequest | undefined, {} | undefined]>;

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
NameDescription
request protos.google.pubsub.v1.IDeleteSubscriptionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSubscriptionRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

include:samples/generated/v1/subscriber.delete_subscription.js region_tag:pubsub_v1_generated_Subscriber_DeleteSubscription_async

deleteSubscription(request, options, callback)

deleteSubscription(request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IDeleteSubscriptionRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteSubscription(request, callback)

deleteSubscription(request: protos.google.pubsub.v1.IDeleteSubscriptionRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IDeleteSubscriptionRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IDeleteSubscriptionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getIamPolicy(request, options, callback)

getIamPolicy(request: IamProtos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<IamProtos.google.iam.v1.Policy>;

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

Parameters
NameDescription
request IamProtos.google.iam.v1.GetIamPolicyRequest

The request object that will be sent.

options gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See [gax.CallOptions]https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html for the details.

callback Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing [Policy].

Returns
TypeDescription
Promise<IamProtos.google.iam.v1.Policy>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Policy]. The promise has a method named "cancel" which cancels the ongoing API call.

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

getSnapshot(request, options)

getSnapshot(request?: protos.google.pubsub.v1.IGetSnapshotRequest, options?: CallOptions): Promise<[protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IGetSnapshotRequest | undefined, {} | undefined]>;

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
NameDescription
request protos.google.pubsub.v1.IGetSnapshotRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IGetSnapshotRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Snapshot]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

include:samples/generated/v1/subscriber.get_snapshot.js region_tag:pubsub_v1_generated_Subscriber_GetSnapshot_async

getSnapshot(request, options, callback)

getSnapshot(request: protos.google.pubsub.v1.IGetSnapshotRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IGetSnapshotRequest
options CallOptions
callback Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getSnapshot(request, callback)

getSnapshot(request: protos.google.pubsub.v1.IGetSnapshotRequest, callback: Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IGetSnapshotRequest
callback Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IGetSnapshotRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getSubscription(request, options)

getSubscription(request?: protos.google.pubsub.v1.IGetSubscriptionRequest, options?: CallOptions): Promise<[protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IGetSubscriptionRequest | undefined, {} | undefined]>;

Gets the configuration details of a subscription.

Parameters
NameDescription
request protos.google.pubsub.v1.IGetSubscriptionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IGetSubscriptionRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Subscription]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

include:samples/generated/v1/subscriber.get_subscription.js region_tag:pubsub_v1_generated_Subscriber_GetSubscription_async

getSubscription(request, options, callback)

getSubscription(request: protos.google.pubsub.v1.IGetSubscriptionRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IGetSubscriptionRequest
options CallOptions
callback Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getSubscription(request, callback)

getSubscription(request: protos.google.pubsub.v1.IGetSubscriptionRequest, callback: Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IGetSubscriptionRequest
callback Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IGetSubscriptionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

listSnapshots(request, options)

listSnapshots(request?: protos.google.pubsub.v1.IListSnapshotsRequest, options?: CallOptions): Promise<[protos.google.pubsub.v1.ISnapshot[], protos.google.pubsub.v1.IListSnapshotsRequest | null, protos.google.pubsub.v1.IListSnapshotsResponse]>;

Lists the existing snapshots. Snapshots are used in [Seek]( https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

Parameters
NameDescription
request protos.google.pubsub.v1.IListSnapshotsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.pubsub.v1.ISnapshot[], protos.google.pubsub.v1.IListSnapshotsRequest | null, protos.google.pubsub.v1.IListSnapshotsResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [Snapshot]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listSnapshotsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listSnapshots(request, options, callback)

listSnapshots(request: protos.google.pubsub.v1.IListSnapshotsRequest, options: CallOptions, callback: PaginationCallback<protos.google.pubsub.v1.IListSnapshotsRequest, protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, protos.google.pubsub.v1.ISnapshot>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IListSnapshotsRequest
options CallOptions
callback PaginationCallback<protos.google.pubsub.v1.IListSnapshotsRequest, protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, protos.google.pubsub.v1.ISnapshot>
Returns
TypeDescription
void

listSnapshots(request, callback)

listSnapshots(request: protos.google.pubsub.v1.IListSnapshotsRequest, callback: PaginationCallback<protos.google.pubsub.v1.IListSnapshotsRequest, protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, protos.google.pubsub.v1.ISnapshot>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IListSnapshotsRequest
callback PaginationCallback<protos.google.pubsub.v1.IListSnapshotsRequest, protos.google.pubsub.v1.IListSnapshotsResponse | null | undefined, protos.google.pubsub.v1.ISnapshot>
Returns
TypeDescription
void

listSnapshotsAsync(request, options)

listSnapshotsAsync(request?: protos.google.pubsub.v1.IListSnapshotsRequest, options?: CallOptions): AsyncIterable<protos.google.pubsub.v1.ISnapshot>;

Equivalent to listSnapshots, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request protos.google.pubsub.v1.IListSnapshotsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.pubsub.v1.ISnapshot>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Snapshot]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example

include:samples/generated/v1/subscriber.list_snapshots.js region_tag:pubsub_v1_generated_Subscriber_ListSnapshots_async

listSnapshotsStream(request, options)

listSnapshotsStream(request?: protos.google.pubsub.v1.IListSnapshotsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.pubsub.v1.IListSnapshotsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [Snapshot] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listSnapshotsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listSubscriptions(request, options)

listSubscriptions(request?: protos.google.pubsub.v1.IListSubscriptionsRequest, options?: CallOptions): Promise<[protos.google.pubsub.v1.ISubscription[], protos.google.pubsub.v1.IListSubscriptionsRequest | null, protos.google.pubsub.v1.IListSubscriptionsResponse]>;

Lists matching subscriptions.

Parameters
NameDescription
request protos.google.pubsub.v1.IListSubscriptionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.pubsub.v1.ISubscription[], protos.google.pubsub.v1.IListSubscriptionsRequest | null, protos.google.pubsub.v1.IListSubscriptionsResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [Subscription]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listSubscriptionsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listSubscriptions(request, options, callback)

listSubscriptions(request: protos.google.pubsub.v1.IListSubscriptionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.pubsub.v1.IListSubscriptionsRequest, protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, protos.google.pubsub.v1.ISubscription>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IListSubscriptionsRequest
options CallOptions
callback PaginationCallback<protos.google.pubsub.v1.IListSubscriptionsRequest, protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, protos.google.pubsub.v1.ISubscription>
Returns
TypeDescription
void

listSubscriptions(request, callback)

listSubscriptions(request: protos.google.pubsub.v1.IListSubscriptionsRequest, callback: PaginationCallback<protos.google.pubsub.v1.IListSubscriptionsRequest, protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, protos.google.pubsub.v1.ISubscription>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IListSubscriptionsRequest
callback PaginationCallback<protos.google.pubsub.v1.IListSubscriptionsRequest, protos.google.pubsub.v1.IListSubscriptionsResponse | null | undefined, protos.google.pubsub.v1.ISubscription>
Returns
TypeDescription
void

listSubscriptionsAsync(request, options)

listSubscriptionsAsync(request?: protos.google.pubsub.v1.IListSubscriptionsRequest, options?: CallOptions): AsyncIterable<protos.google.pubsub.v1.ISubscription>;

Equivalent to listSubscriptions, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request protos.google.pubsub.v1.IListSubscriptionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.pubsub.v1.ISubscription>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Subscription]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example

include:samples/generated/v1/subscriber.list_subscriptions.js region_tag:pubsub_v1_generated_Subscriber_ListSubscriptions_async

listSubscriptionsStream(request, options)

listSubscriptionsStream(request?: protos.google.pubsub.v1.IListSubscriptionsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.pubsub.v1.IListSubscriptionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [Subscription] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listSubscriptionsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
NameDescription
projectName string

A fully-qualified path representing Project resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectTopicName(projectTopicName)

matchProjectFromProjectTopicName(projectTopicName: string): string | number;

Parse the project from ProjectTopic resource.

Parameter
NameDescription
projectTopicName string

A fully-qualified path representing project_topic resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromSchemaName(schemaName)

matchProjectFromSchemaName(schemaName: string): string | number;

Parse the project from Schema resource.

Parameter
NameDescription
schemaName string

A fully-qualified path representing Schema resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromSnapshotName(snapshotName)

matchProjectFromSnapshotName(snapshotName: string): string | number;

Parse the project from Snapshot resource.

Parameter
NameDescription
snapshotName string

A fully-qualified path representing Snapshot resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromSubscriptionName(subscriptionName)

matchProjectFromSubscriptionName(subscriptionName: string): string | number;

Parse the project from Subscription resource.

Parameter
NameDescription
subscriptionName string

A fully-qualified path representing Subscription resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchSchemaFromSchemaName(schemaName)

matchSchemaFromSchemaName(schemaName: string): string | number;

Parse the schema from Schema resource.

Parameter
NameDescription
schemaName string

A fully-qualified path representing Schema resource.

Returns
TypeDescription
string | number

{string} A string representing the schema.

matchSnapshotFromSnapshotName(snapshotName)

matchSnapshotFromSnapshotName(snapshotName: string): string | number;

Parse the snapshot from Snapshot resource.

Parameter
NameDescription
snapshotName string

A fully-qualified path representing Snapshot resource.

Returns
TypeDescription
string | number

{string} A string representing the snapshot.

matchSubscriptionFromSubscriptionName(subscriptionName)

matchSubscriptionFromSubscriptionName(subscriptionName: string): string | number;

Parse the subscription from Subscription resource.

Parameter
NameDescription
subscriptionName string

A fully-qualified path representing Subscription resource.

Returns
TypeDescription
string | number

{string} A string representing the subscription.

matchTopicFromProjectTopicName(projectTopicName)

matchTopicFromProjectTopicName(projectTopicName: string): string | number;

Parse the topic from ProjectTopic resource.

Parameter
NameDescription
projectTopicName string

A fully-qualified path representing project_topic resource.

Returns
TypeDescription
string | number

{string} A string representing the topic.

modifyAckDeadline(request, options)

modifyAckDeadline(request?: protos.google.pubsub.v1.IModifyAckDeadlineRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyAckDeadlineRequest | undefined, {} | undefined]>;

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
NameDescription
request protos.google.pubsub.v1.IModifyAckDeadlineRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyAckDeadlineRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

include:samples/generated/v1/subscriber.modify_ack_deadline.js region_tag:pubsub_v1_generated_Subscriber_ModifyAckDeadline_async

modifyAckDeadline(request, options, callback)

modifyAckDeadline(request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IModifyAckDeadlineRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

modifyAckDeadline(request, callback)

modifyAckDeadline(request: protos.google.pubsub.v1.IModifyAckDeadlineRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IModifyAckDeadlineRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyAckDeadlineRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

modifyPushConfig(request, options)

modifyPushConfig(request?: protos.google.pubsub.v1.IModifyPushConfigRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyPushConfigRequest | undefined, {} | undefined]>;

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
NameDescription
request protos.google.pubsub.v1.IModifyPushConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyPushConfigRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

include:samples/generated/v1/subscriber.modify_push_config.js region_tag:pubsub_v1_generated_Subscriber_ModifyPushConfig_async

modifyPushConfig(request, options, callback)

modifyPushConfig(request: protos.google.pubsub.v1.IModifyPushConfigRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IModifyPushConfigRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

modifyPushConfig(request, callback)

modifyPushConfig(request: protos.google.pubsub.v1.IModifyPushConfigRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IModifyPushConfigRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.pubsub.v1.IModifyPushConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
NameDescription
project string
Returns
TypeDescription
string

{string} Resource name string.

projectTopicPath(project, topic)

projectTopicPath(project: string, topic: string): string;

Return a fully-qualified projectTopic resource name string.

Parameters
NameDescription
project string
topic string
Returns
TypeDescription
string

{string} Resource name string.

pull(request, options)

pull(request?: protos.google.pubsub.v1.IPullRequest, options?: CallOptions): Promise<[protos.google.pubsub.v1.IPullResponse, protos.google.pubsub.v1.IPullRequest | undefined, {} | undefined]>;

Pulls messages from the server. The server may return UNAVAILABLE if there are too many concurrent pull requests pending for the given subscription.

Parameters
NameDescription
request protos.google.pubsub.v1.IPullRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.pubsub.v1.IPullResponse, protos.google.pubsub.v1.IPullRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [PullResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

include:samples/generated/v1/subscriber.pull.js region_tag:pubsub_v1_generated_Subscriber_Pull_async

pull(request, options, callback)

pull(request: protos.google.pubsub.v1.IPullRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.IPullResponse, protos.google.pubsub.v1.IPullRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IPullRequest
options CallOptions
callback Callback<protos.google.pubsub.v1.IPullResponse, protos.google.pubsub.v1.IPullRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

pull(request, callback)

pull(request: protos.google.pubsub.v1.IPullRequest, callback: Callback<protos.google.pubsub.v1.IPullResponse, protos.google.pubsub.v1.IPullRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IPullRequest
callback Callback<protos.google.pubsub.v1.IPullResponse, protos.google.pubsub.v1.IPullRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

schemaPath(project, schema)

schemaPath(project: string, schema: string): string;

Return a fully-qualified schema resource name string.

Parameters
NameDescription
project string
schema string
Returns
TypeDescription
string

{string} Resource name string.

seek(request, options)

seek(request?: protos.google.pubsub.v1.ISeekRequest, options?: CallOptions): Promise<[protos.google.pubsub.v1.ISeekResponse, protos.google.pubsub.v1.ISeekRequest | undefined, {} | undefined]>;

Seeks an existing subscription to a point in time or to a given snapshot, whichever is provided in the request. Snapshots are used in [Seek] (https://cloud.google.com/pubsub/docs/replay-overview) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. Note that both the subscription and the snapshot must be on the same topic.

Parameters
NameDescription
request protos.google.pubsub.v1.ISeekRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.pubsub.v1.ISeekResponse, protos.google.pubsub.v1.ISeekRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [SeekResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

include:samples/generated/v1/subscriber.seek.js region_tag:pubsub_v1_generated_Subscriber_Seek_async

seek(request, options, callback)

seek(request: protos.google.pubsub.v1.ISeekRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISeekResponse, protos.google.pubsub.v1.ISeekRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.ISeekRequest
options CallOptions
callback Callback<protos.google.pubsub.v1.ISeekResponse, protos.google.pubsub.v1.ISeekRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

seek(request, callback)

seek(request: protos.google.pubsub.v1.ISeekRequest, callback: Callback<protos.google.pubsub.v1.ISeekResponse, protos.google.pubsub.v1.ISeekRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.ISeekRequest
callback Callback<protos.google.pubsub.v1.ISeekResponse, protos.google.pubsub.v1.ISeekRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

setIamPolicy(request, options, callback)

setIamPolicy(request: IamProtos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<IamProtos.google.iam.v1.Policy>;

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

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

Parameters
NameDescription
request IamProtos.google.iam.v1.SetIamPolicyRequest

The request object that will be sent.

options gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See [gax.CallOptions]https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html for the details.

callback Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing [TestIamPermissionsResponse].

Returns
TypeDescription
Promise<IamProtos.google.iam.v1.Policy>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [TestIamPermissionsResponse]. The promise has a method named "cancel" which cancels the ongoing API call.

snapshotPath(project, snapshot)

snapshotPath(project: string, snapshot: string): string;

Return a fully-qualified snapshot resource name string.

Parameters
NameDescription
project string
snapshot string
Returns
TypeDescription
string

{string} Resource name string.

streamingPull(options)

streamingPull(options?: CallOptions): gax.CancellableStream;

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
NameDescription
options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
gax.CancellableStream

{Stream} An object stream which is both readable and writable. It accepts objects representing [StreamingPullRequest] for write() method, and will emit objects representing [StreamingPullResponse] on 'data' event asynchronously. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) for more details and examples.

Example

include:samples/generated/v1/subscriber.streaming_pull.js region_tag:pubsub_v1_generated_Subscriber_StreamingPull_async

subscriptionPath(project, subscription)

subscriptionPath(project: string, subscription: string): string;

Return a fully-qualified subscription resource name string.

Parameters
NameDescription
project string
subscription string
Returns
TypeDescription
string

{string} Resource name string.

testIamPermissions(request, options, callback)

testIamPermissions(request: IamProtos.google.iam.v1.TestIamPermissionsRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>): Promise<IamProtos.google.iam.v1.TestIamPermissionsResponse>;

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

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

Parameters
NameDescription
request IamProtos.google.iam.v1.TestIamPermissionsRequest

The request object that will be sent.

options gax.CallOptions | Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See [gax.CallOptions]https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html for the details.

callback Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing [TestIamPermissionsResponse].

Returns
TypeDescription
Promise<IamProtos.google.iam.v1.TestIamPermissionsResponse>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [TestIamPermissionsResponse]. The promise has a method named "cancel" which cancels the ongoing API call.

updateSnapshot(request, options)

updateSnapshot(request?: protos.google.pubsub.v1.IUpdateSnapshotRequest, options?: CallOptions): Promise<[protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IUpdateSnapshotRequest | undefined, {} | undefined]>;

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

Parameters
NameDescription
request protos.google.pubsub.v1.IUpdateSnapshotRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IUpdateSnapshotRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Snapshot]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

include:samples/generated/v1/subscriber.update_snapshot.js region_tag:pubsub_v1_generated_Subscriber_UpdateSnapshot_async

updateSnapshot(request, options, callback)

updateSnapshot(request: protos.google.pubsub.v1.IUpdateSnapshotRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IUpdateSnapshotRequest
options CallOptions
callback Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateSnapshot(request, callback)

updateSnapshot(request: protos.google.pubsub.v1.IUpdateSnapshotRequest, callback: Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IUpdateSnapshotRequest
callback Callback<protos.google.pubsub.v1.ISnapshot, protos.google.pubsub.v1.IUpdateSnapshotRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateSubscription(request, options)

updateSubscription(request?: protos.google.pubsub.v1.IUpdateSubscriptionRequest, options?: CallOptions): Promise<[protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IUpdateSubscriptionRequest | undefined, {} | undefined]>;

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

Parameters
NameDescription
request protos.google.pubsub.v1.IUpdateSubscriptionRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IUpdateSubscriptionRequest | undefined, {} | undefined]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [Subscription]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

include:samples/generated/v1/subscriber.update_subscription.js region_tag:pubsub_v1_generated_Subscriber_UpdateSubscription_async

updateSubscription(request, options, callback)

updateSubscription(request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, options: CallOptions, callback: Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IUpdateSubscriptionRequest
options CallOptions
callback Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateSubscription(request, callback)

updateSubscription(request: protos.google.pubsub.v1.IUpdateSubscriptionRequest, callback: Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.pubsub.v1.IUpdateSubscriptionRequest
callback Callback<protos.google.pubsub.v1.ISubscription, protos.google.pubsub.v1.IUpdateSubscriptionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void