pubsub.Message class
Stay organized with collections
Save and categorize content based on your preferences.
Interface representing a Google Cloud Pub/Sub message.
Signature:
export declare class Message
Constructors
Constructor |
Modifiers |
Description |
(constructor)(data) |
|
Constructs a new instance of the Message class |
Properties
Property |
Modifiers |
Type |
Description |
attributes |
|
{ [key: string]: string; } |
User-defined attributes published with the message, if any. |
data |
|
string |
The data payload of this message object as a base64-encoded string. |
json |
|
any |
The JSON data payload of this message object, if any. |
Methods
Method |
Modifiers |
Description |
toJSON() |
|
Returns a JSON-serializable representation of this object. |
pubsub.Message.(constructor)
Constructs a new instance of the Message
class
Signature:
constructor(data: any);
Parameters
Parameter |
Type |
Description |
data |
any |
|
pubsub.Message.attributes
User-defined attributes published with the message, if any.
Signature:
readonly attributes: {
[key: string]: string;
};
pubsub.Message.data
The data payload of this message object as a base64-encoded string.
Signature:
readonly data: string;
pubsub.Message.json
The JSON data payload of this message object, if any.
Signature:
get json(): any;
pubsub.Message.toJSON()
Returns a JSON-serializable representation of this object.
Signature:
toJSON(): any;
Returns:
any
A JSON-serializable representation of this object.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-09-13 UTC.
[null,null,["Last updated 2022-09-13 UTC."],[],[],null,["# pubsub.Message class\n\nInterface representing a Google Cloud Pub/Sub message.\n\n**Signature:** \n\n export declare class Message \n\nConstructors\n------------\n\n| Constructor | Modifiers | Description |\n|----------------------------------------------------------------------------------------|-----------|--------------------------------------------------|\n| [(constructor)(data)](./firebase-functions.pubsub.message.md#pubsubmessageconstructor) | | Constructs a new instance of the `Message` class |\n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|------------------------------------------------------------------------------|-----------|------------------------------|---------------------------------------------------------------------|\n| [attributes](./firebase-functions.pubsub.message.md#pubsubmessageattributes) | | { \\[key: string\\]: string; } | User-defined attributes published with the message, if any. |\n| [data](./firebase-functions.pubsub.message.md#pubsubmessagedata) | | string | The data payload of this message object as a base64-encoded string. |\n| [json](./firebase-functions.pubsub.message.md#pubsubmessagejson) | | any | The JSON data payload of this message object, if any. |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|------------------------------------------------------------------------|-----------|------------------------------------------------------------|\n| [toJSON()](./firebase-functions.pubsub.message.md#pubsubmessagetojson) | | Returns a JSON-serializable representation of this object. |\n\npubsub.Message.(constructor)\n----------------------------\n\nConstructs a new instance of the `Message` class\n\n**Signature:** \n\n constructor(data: any);\n\n### Parameters\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| data | any | |\n\npubsub.Message.attributes\n-------------------------\n\nUser-defined attributes published with the message, if any.\n\n**Signature:** \n\n readonly attributes: {\n [key: string]: string;\n };\n\npubsub.Message.data\n-------------------\n\nThe data payload of this message object as a base64-encoded string.\n\n**Signature:** \n\n readonly data: string;\n\npubsub.Message.json\n-------------------\n\nThe JSON data payload of this message object, if any.\n\n**Signature:** \n\n get json(): any;\n\npubsub.Message.toJSON()\n-----------------------\n\nReturns a JSON-serializable representation of this object.\n\n**Signature:** \n\n toJSON(): any;\n\n**Returns:**\n\nany\n\nA JSON-serializable representation of this object."]]