Constructor
new UnsubscribersClient(optionsopt)
Construct an instance of UnsubscribersClient.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. See the subsequent parameters for more details. Properties
|
Members
apiEndpoint
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
port
The port for this API service.
scopes
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
The DNS address for this API service.
Methods
close()
Terminate the GRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
createUnsubscriber(request, optionsopt) → {Promise}
Creates an unsubscriber.
The caller must have messaging.unsubscribers.create
permission on the project.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Promise |
|
deleteUnsubscriber(request, optionsopt) → {Promise}
Deletes an unsubscriber.
The caller must have messaging.unsubscribers.delete
permission on the project.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Promise |
|
getProjectId(callback)
Return the project ID used by this class.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
the callback to be called with the current project Id. |
getUnsubscriber(request, optionsopt) → {Promise}
Retrieves a Unsubscriber identified by the supplied resource name.
The caller must have messaging.unsubscribers.get
permission on the project.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Promise |
|
initialize() → {Promise}
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:
Type | Description |
---|---|
Promise |
A promise that resolves to an authenticated service stub. |
listUnsubscribers(request, optionsopt) → {Promise}
Lists the Unsubscribers of the specified project. List returns Unsubscribers sorted by create_time descending.
The caller must have messaging.unsubscribers.list
permission on the project.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Promise |
|
listUnsubscribersAsync(request, optionsopt) → {Object}
Equivalent to listUnsubscribers, but returns an iterable object.
for-await-of syntax is used with the iterable to recursively get response element on-demand.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. |
listUnsubscribersStream(request, optionsopt) → {Stream}
Equivalent to listUnsubscribers, but returns a NodeJS Stream object.
This fetches the paged responses for listUnsubscribers continuously and invokes the callback registered for 'data' event for each element in the responses.
The returned object has 'end' method when no more elements are required.
autoPaginate option will be ignored.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing Unsubscriber on 'data' event. |
matchMessageFromMessageName(messageName) → {string}
Parse the message from Message resource.
Parameters:
Name | Type | Description |
---|---|---|
messageName |
string |
A fully-qualified path representing Message resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the message. |
matchProjectFromMessageName(messageName) → {string}
Parse the project from Message resource.
Parameters:
Name | Type | Description |
---|---|---|
messageName |
string |
A fully-qualified path representing Message resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromUnsubscriberName(unsubscriberName) → {string}
Parse the project from Unsubscriber resource.
Parameters:
Name | Type | Description |
---|---|---|
unsubscriberName |
string |
A fully-qualified path representing Unsubscriber resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchUnsubscriberFromUnsubscriberName(unsubscriberName) → {string}
Parse the unsubscriber from Unsubscriber resource.
Parameters:
Name | Type | Description |
---|---|---|
unsubscriberName |
string |
A fully-qualified path representing Unsubscriber resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the unsubscriber. |
messagePath(project, message) → {string}
Return a fully-qualified message resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
message |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
unsubscriberPath(project, unsubscriber) → {string}
Return a fully-qualified unsubscriber resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
unsubscriber |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
updateUnsubscriber(request, optionsopt) → {Promise}
Updates an unsubscriber.
The caller must have messaging.unsubscribers.update
permission on the project.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Promise |
|