Class: Payload
Represents some binary (byte array) data (ex: activity input parameters or workflow result) with metadata which describes this binary data (format, encoding, encryption, etc). Serialization of the data may be user-defined.
Implements
Constructors
constructor
• new Payload(properties?
): Payload
Constructs a new Payload.
Parameters
Name | Type | Description |
---|---|---|
properties? | IPayload | Properties to set |
Returns
Properties
data
• data: Uint8Array
Payload data.
Implementation of
metadata
• metadata: Object
Payload metadata.
Index signature
▪ [k: string
]: Uint8Array
Implementation of
Methods
toJSON
▸ toJSON(): Object
Converts this Payload to JSON.
Returns
Object
JSON object
create
▸ create(properties?
): Payload
Creates a new Payload instance using the specified properties.
Parameters
Name | Type | Description |
---|---|---|
properties? | IPayload | Properties to set |
Returns
Payload instance
decode
▸ decode(reader
, length?
): Payload
Decodes a Payload message from the specified reader or buffer.
Parameters
Name | Type | Description |
---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
length? | number | Message length if known beforehand |
Returns
Payload
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing