Skip to main content

Class: UpdateResponse

coresdk.workflow_commands.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.

Implements

Constructors

constructor

new UpdateResponse(properties?): UpdateResponse

Constructs a new UpdateResponse.

Parameters

NameTypeDescription
properties?IUpdateResponseProperties to set

Returns

UpdateResponse

Properties

accepted

Optional accepted: null | IEmpty

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).

Implementation of

IUpdateResponse.accepted


completed

Optional completed: null | IPayload

Must be sent once the update handler completes successfully.

Implementation of

IUpdateResponse.completed


protocolInstanceId

protocolInstanceId: string

The protocol message instance ID

Implementation of

IUpdateResponse.protocolInstanceId


rejected

Optional rejected: null | IFailure

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

Implementation of

IUpdateResponse.rejected


response

Optional response: "completed" | "accepted" | "rejected"

UpdateResponse response.

Methods

toJSON

toJSON(): Object

Converts this UpdateResponse to JSON.

Returns

Object

JSON object


create

create(properties?): UpdateResponse

Creates a new UpdateResponse instance using the specified properties.

Parameters

NameTypeDescription
properties?IUpdateResponseProperties to set

Returns

UpdateResponse

UpdateResponse instance


decode

decode(reader, length?): UpdateResponse

Decodes an UpdateResponse message from the specified reader or buffer.

Parameters

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

Returns

UpdateResponse

UpdateResponse

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): UpdateResponse

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

UpdateResponse

UpdateResponse

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 UpdateResponse message. Does not implicitly coresdk.workflow_commands.UpdateResponse.verify|verify messages.

Parameters

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

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

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

Parameters

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

Returns

Writer

Writer


fromObject

fromObject(object): UpdateResponse

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

Parameters

NameTypeDescription
objectObjectPlain object

Returns

UpdateResponse

UpdateResponse


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for UpdateResponse

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 an UpdateResponse message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageUpdateResponseUpdateResponse
options?IConversionOptionsConversion options

Returns

Object

Plain object