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/pubsubConstructors
(constructor)(opts, gaxInstance)
constructor
(
opts
?:
ClientOptions
,
gaxInstance
?:
typeof
gax
|
typeof
gax
.
fallback
);
Construct an instance of SubscriberClient.
opts
ClientOptions
gaxInstance
typeof gax
| typeof fallback
: loaded instance of google-gax
. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new SubscriberClient({fallback: true}, gax); ```
Properties
apiEndpoint
get
apiEndpoint
()
:
string
;
The DNS address for this API service.
apiEndpoint
static
get
apiEndpoint
()
:
string
;
The DNS address for this API service - same as servicePath.
auth
auth
:
gax
.
GoogleAuth
;
descriptors
descriptors
:
Descriptors
;
iamClient
iamClient
:
IamClient
;
innerApiCalls
innerApiCalls
:
{
[
name
:
string
]
:
Function
;
};
pathTemplates
pathTemplates
:
{
[
name
:
string
]
:
gax
.
PathTemplate
;
};
port
static
get
port
()
:
number
;
The port for this API service.
scopes
static
get
scopes
()
:
string
[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static
get
servicePath
()
:
string
;
The DNS address for this API service.
subscriberStub
subscriberStub
?:
Promise
< {
[
name
:
string
]
:
Function
;
}>;
universeDomain
get
universeDomain
()
:
string
;
warn
warn
:
(
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.
request
options
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 for more details and examples.
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
;
request
options
CallOptions
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.pubsub.v1.IAcknowledgeRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.pubsub.v1.IAcknowledgeRequest
| null | undefined, {} | null | undefined>
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.
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/pubsub-basics#resource_names). The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request.
request
options
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 for more details and examples.
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
;
request
options
CallOptions
callback
Callback
< protos.google.pubsub.v1.ISnapshot
, protos.google.pubsub.v1.ICreateSnapshotRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.pubsub.v1.ISnapshot
, protos.google.pubsub.v1.ICreateSnapshotRequest
| null | undefined, {} | null | undefined>
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/pubsub-basics#resource_names). If the subscription already exists, returns ALREADY_EXISTS
. If the corresponding topic doesn't exist, returns NOT_FOUND
.
If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.
request
options
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 . Please see the documentation for more details and examples.
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
;
request
options
CallOptions
callback
Callback
< protos.google.pubsub.v1.ISubscription
, protos.google.pubsub.v1.ISubscription
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.pubsub.v1.ISubscription
, protos.google.pubsub.v1.ISubscription
| null | undefined, {} | null | undefined>
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.
request
options
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 for more details and examples.
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
;
request
options
CallOptions
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.pubsub.v1.IDeleteSnapshotRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.pubsub.v1.IDeleteSnapshotRequest
| null | undefined, {} | null | undefined>
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.
request
options
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 for more details and examples.
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
;
request
options
CallOptions
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.pubsub.v1.IDeleteSubscriptionRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.pubsub.v1.IDeleteSubscriptionRequest
| null | undefined, {} | null | undefined>
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.
request
IamProtos.google.iam.v1.GetIamPolicyRequest
The request object that will be sent.
options
CallOptions
| Callback
< google.iam.v1.Policy
, 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 for the details.
callback
Callback
< google.iam.v1.Policy
, 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 .
Promise
<[ google.iam.v1.Policy
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.
getProjectId()
getProjectId
()
:
Promise<string>
;
Promise
<string>
getProjectId(callback)
getProjectId
(
callback
:
Callback<string
,
undefined
,
undefined
> )
:
void
;
callback
Callback
<string, undefined, undefined>
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]( https://cloud.google.com/pubsub/docs/replay-overview ) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.
request
options
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 for more details and examples.
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
;
request
options
CallOptions
callback
Callback
< protos.google.pubsub.v1.ISnapshot
, protos.google.pubsub.v1.IGetSnapshotRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.pubsub.v1.ISnapshot
, protos.google.pubsub.v1.IGetSnapshotRequest
| null | undefined, {} | null | undefined>
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.
request
options
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 . Please see the documentation for more details and examples.
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
;
request
options
CallOptions
callback
Callback
< protos.google.pubsub.v1.ISubscription
, protos.google.pubsub.v1.IGetSubscriptionRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.pubsub.v1.ISubscription
, protos.google.pubsub.v1.IGetSubscriptionRequest
| null | undefined, {} | null | undefined>
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.
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.
request
options
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
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
;
request
options
CallOptions
callback
PaginationCallback
< protos.google.pubsub.v1.IListSnapshotsRequest
, protos.google.pubsub.v1.IListSnapshotsResponse
| null | undefined, protos.google.pubsub.v1.ISnapshot
>
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
;
request
callback
PaginationCallback
< protos.google.pubsub.v1.IListSnapshotsRequest
, protos.google.pubsub.v1.IListSnapshotsResponse
| null | undefined, protos.google.pubsub.v1.ISnapshot
>
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.
request
options
AsyncIterable
< protos.google.pubsub.v1.ISnapshot
>
{Object} An iterable Object that allows async iteration . 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 for more details and examples.
listSnapshotsStream(request, options)
listSnapshotsStream
(
request
?:
protos
.
google
.
pubsub
.
v1
.
IListSnapshotsRequest
,
options
?:
CallOptions
)
:
Transform
;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
request
options
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
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.
request
options
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 . 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
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
;
request
options
CallOptions
callback
PaginationCallback
< protos.google.pubsub.v1.IListSubscriptionsRequest
, protos.google.pubsub.v1.IListSubscriptionsResponse
| null | undefined, protos.google.pubsub.v1.ISubscription
>
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
;
request
callback
PaginationCallback
< protos.google.pubsub.v1.IListSubscriptionsRequest
, protos.google.pubsub.v1.IListSubscriptionsResponse
| null | undefined, protos.google.pubsub.v1.ISubscription
>
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.
request
options
AsyncIterable
< protos.google.pubsub.v1.ISubscription
>
{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing . 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 for more details and examples.
listSubscriptionsStream(request, options)
listSubscriptionsStream
(
request
?:
protos
.
google
.
pubsub
.
v1
.
IListSubscriptionsRequest
,
options
?:
CallOptions
)
:
Transform
;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
request
options
Transform
{Stream} An object stream which emits an object representing 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
for more details and examples.
matchProjectFromProjectName(projectName)
matchProjectFromProjectName
(
projectName
:
string
)
:
string
|
number
;
Parse the project from Project resource.
projectName
string
A fully-qualified path representing Project resource.
string | number
{string} A string representing the project.
matchProjectFromProjectTopicName(projectTopicName)
matchProjectFromProjectTopicName
(
projectTopicName
:
string
)
:
string
|
number
;
Parse the project from ProjectTopic resource.
projectTopicName
string
A fully-qualified path representing project_topic resource.
string | number
{string} A string representing the project.
matchProjectFromSchemaName(schemaName)
matchProjectFromSchemaName
(
schemaName
:
string
)
:
string
|
number
;
Parse the project from Schema resource.
schemaName
string
A fully-qualified path representing Schema resource.
string | number
{string} A string representing the project.
matchProjectFromSnapshotName(snapshotName)
matchProjectFromSnapshotName
(
snapshotName
:
string
)
:
string
|
number
;
Parse the project from Snapshot resource.
snapshotName
string
A fully-qualified path representing Snapshot resource.
string | number
{string} A string representing the project.
matchProjectFromSubscriptionName(subscriptionName)
matchProjectFromSubscriptionName
(
subscriptionName
:
string
)
:
string
|
number
;
Parse the project from Subscription resource.
subscriptionName
string
A fully-qualified path representing Subscription resource.
string | number
{string} A string representing the project.
matchSchemaFromSchemaName(schemaName)
matchSchemaFromSchemaName
(
schemaName
:
string
)
:
string
|
number
;
Parse the schema from Schema resource.
schemaName
string
A fully-qualified path representing Schema resource.
string | number
{string} A string representing the schema.
matchSnapshotFromSnapshotName(snapshotName)
matchSnapshotFromSnapshotName
(
snapshotName
:
string
)
:
string
|
number
;
Parse the snapshot from Snapshot resource.
snapshotName
string
A fully-qualified path representing Snapshot resource.
string | number
{string} A string representing the snapshot.
matchSubscriptionFromSubscriptionName(subscriptionName)
matchSubscriptionFromSubscriptionName
(
subscriptionName
:
string
)
:
string
|
number
;
Parse the subscription from Subscription resource.
subscriptionName
string
A fully-qualified path representing Subscription resource.
string | number
{string} A string representing the subscription.
matchTopicFromProjectTopicName(projectTopicName)
matchTopicFromProjectTopicName
(
projectTopicName
:
string
)
:
string
|
number
;
Parse the topic from ProjectTopic resource.
projectTopicName
string
A fully-qualified path representing project_topic resource.
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.
request
options
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 for more details and examples.
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
;
request
options
CallOptions
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.pubsub.v1.IModifyAckDeadlineRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.pubsub.v1.IModifyAckDeadlineRequest
| null | undefined, {} | null | undefined>
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
.
request
options
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 for more details and examples.
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
;
request
options
CallOptions
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.pubsub.v1.IModifyPushConfigRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.pubsub.v1.IModifyPushConfigRequest
| null | undefined, {} | null | undefined>
void
projectPath(project)
projectPath
(
project
:
string
)
:
string
;
Return a fully-qualified project resource name string.
project
string
string
{string} Resource name string.
projectTopicPath(project, topic)
projectTopicPath
(
project
:
string
,
topic
:
string
)
:
string
;
Return a fully-qualified projectTopic resource name string.
project
string
topic
string
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.
request
options
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 for more details and examples.
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
;
request
options
CallOptions
callback
Callback
< protos.google.pubsub.v1.IPullResponse
, protos.google.pubsub.v1.IPullRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.pubsub.v1.IPullResponse
, protos.google.pubsub.v1.IPullRequest
| null | undefined, {} | null | undefined>
void
schemaPath(project, schema)
schemaPath
(
project
:
string
,
schema
:
string
)
:
string
;
Return a fully-qualified schema resource name string.
project
string
schema
string
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.
request
options
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 for more details and examples.
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
;
request
options
CallOptions
callback
Callback
< protos.google.pubsub.v1.ISeekResponse
, protos.google.pubsub.v1.ISeekRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.pubsub.v1.ISeekResponse
, protos.google.pubsub.v1.ISeekRequest
| null | undefined, {} | null | undefined>
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.
request
IamProtos.google.iam.v1.SetIamPolicyRequest
The request object that will be sent.
options
CallOptions
| Callback
< google.iam.v1.Policy
, 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 for the details.
callback
Callback
< google.iam.v1.Policy
, 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 .
Promise
<[ google.iam.v1.Policy
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . 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.
project
string
snapshot
string
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.
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 on 'data' event asynchronously. Please see the documentation for more details and examples.
subscriptionPath(project, subscription)
subscriptionPath
(
project
:
string
,
subscription
:
string
)
:
string
;
Return a fully-qualified subscription resource name string.
project
string
subscription
string
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.
request
IamProtos.google.iam.v1.TestIamPermissionsRequest
The request object that will be sent.
options
CallOptions
| Callback
< google.iam.v1.TestIamPermissionsResponse
, 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 for the details.
callback
Callback
< google.iam.v1.TestIamPermissionsResponse
, 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 .
Promise
<[ google.iam.v1.TestIamPermissionsResponse
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . 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 by updating the fields specified in the update mask. Snapshots are used in [Seek]( https://cloud.google.com/pubsub/docs/replay-overview ) operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.
request
options
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 for more details and examples.
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
;
request
options
CallOptions
callback
Callback
< protos.google.pubsub.v1.ISnapshot
, protos.google.pubsub.v1.IUpdateSnapshotRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.pubsub.v1.ISnapshot
, protos.google.pubsub.v1.IUpdateSnapshotRequest
| null | undefined, {} | null | undefined>
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 by updating the fields specified in the update mask. Note that certain properties of a subscription, such as its topic, are not modifiable.
request
options
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 . Please see the documentation for more details and examples.
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
;
request
options
CallOptions
callback
Callback
< protos.google.pubsub.v1.ISubscription
, protos.google.pubsub.v1.IUpdateSubscriptionRequest
| null | undefined, {} | null | undefined>
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
;
request
callback
Callback
< protos.google.pubsub.v1.ISubscription
, protos.google.pubsub.v1.IUpdateSubscriptionRequest
| null | undefined, {} | null | undefined>
void