Skip to main content

Class: UpdateResponse

A reply to a DoUpdate job - lang must run the update's validator if told to, and then immediately run the handler, if the update was accepted.

There must always be an accepted or rejected response immediately, in the same activation as this job, to indicate the result of the validator. Accepted for ran and accepted or skipped, or rejected for rejected.

Then, in the same or any subsequent activation, after the update handler has completed, respond with completed or rejected as appropriate for the result of the handler.

Properties​

accepted?​

optional accepted?: $Properties | null

Must be sent if the update's validator has passed (or lang was not asked to run it, and thus should be considered already-accepted, allowing lang to always send the same sequence on replay).


completed?​

optional completed?: $Properties | null

Must be sent once the update handler completes successfully.


protocolInstanceId​

protocolInstanceId: string

The protocol message instance ID


rejected?​

optional rejected?: $Properties | null

Must be sent if the update's validator does not pass, or after acceptance if the update handler fails.


response?​

optional response?: "completed" | "accepted" | "rejected"

UpdateResponse response.

Methods​

toJSON()​

toJSON(): object

Converts this UpdateResponse to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): UpdateResponse & $Shape

Creates a new UpdateResponse instance using the specified properties.

Parameters​
properties?​

$Shape

Properties to set

Returns​

UpdateResponse & $Shape

UpdateResponse instance

Call Signature​

static create(properties?): UpdateResponse

Creates a new UpdateResponse instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

UpdateResponse

UpdateResponse instance


decode()​

static decode(reader, length?): UpdateResponse & $Shape

Decodes an UpdateResponse message from the specified reader or buffer.

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

length?​

number

Message length if known beforehand

Returns​

UpdateResponse & $Shape

UpdateResponse

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): UpdateResponse & $Shape

Decodes an UpdateResponse message from the specified reader or buffer, length delimited.

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

UpdateResponse & $Shape

UpdateResponse

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


encode()​

static encode(message, writer?): Writer

Encodes the specified UpdateResponse message. Does not implicitly coresdk.workflow_commands.UpdateResponse.verify|verify messages.

Parameters​

message​

$Properties

UpdateResponse message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

Encodes the specified UpdateResponse message, length delimited. Does not implicitly coresdk.workflow_commands.UpdateResponse.verify|verify messages.

Parameters​

message​

$Properties

UpdateResponse message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): UpdateResponse

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

Parameters​

object​

{[k: string]: any; }

Plain object

Returns​

UpdateResponse

UpdateResponse


toObject()​

static toObject(message, options?): object

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

Parameters​

message​

UpdateResponse

UpdateResponse

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object