Skip to main content

Class: Message

protocol.v1.Message

(-- api-linter: core::0146::any=disabled aip.dev/not-precedent: We want runtime extensibility for the body field --)

Implements

Constructors

constructor

new Message(properties?): Message

Constructs a new Message.

Parameters

NameTypeDescription
properties?IMessageProperties to set

Returns

Message

Properties

body

Optional body: null | IAny

The opaque data carried by this message. The protocol type can be extracted from the package name of the message carried inside the Any.

Implementation of

IMessage.body


commandIndex

Optional commandIndex: null | Long

Message commandIndex.

Implementation of

IMessage.commandIndex


eventId

Optional eventId: null | Long

Message eventId.

Implementation of

IMessage.eventId


id

id: string

An ID for this specific message.

Implementation of

IMessage.id


protocolInstanceId

protocolInstanceId: string

Identifies the specific instance of a protocol to which this message belongs.

Implementation of

IMessage.protocolInstanceId


sequencingId

Optional sequencingId: "eventId" | "commandIndex"

The event ID or command ID after which this message can be delivered. The effects of history up to and including this event ID should be visible to the code that handles this message. Omit to opt out of sequencing.

Methods

toJSON

toJSON(): Object

Converts this Message to JSON.

Returns

Object

JSON object


create

create(properties?): Message

Creates a new Message instance using the specified properties.

Parameters

NameTypeDescription
properties?IMessageProperties to set

Returns

Message

Message instance


decode

decode(reader, length?): Message

Decodes a Message message from the specified reader or buffer.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage length if known beforehand

Returns

Message

Message

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): Message

Decodes a Message message from the specified reader or buffer, length delimited.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

Message

Message

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


encode

encode(message, writer?): Writer

Encodes the specified Message message. Does not implicitly temporal.api.protocol.v1.Message.verify|verify messages.

Parameters

NameTypeDescription
messageIMessageMessage message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

Encodes the specified Message message, length delimited. Does not implicitly temporal.api.protocol.v1.Message.verify|verify messages.

Parameters

NameTypeDescription
messageIMessageMessage message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

fromObject(object): Message

Creates a Message message from a plain object. Also converts values to their respective internal types.

Parameters

NameTypeDescription
objectObjectPlain object

Returns

Message

Message


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for Message

Parameters

NameTypeDescription
typeUrlPrefix?stringyour custom typeUrlPrefix(default "type.googleapis.com")

Returns

string

The default type url


toObject

toObject(message, options?): Object

Creates a plain object from a Message message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageMessageMessage
options?IConversionOptionsConversion options

Returns

Object

Plain object