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
Name | Type | Description |
---|---|---|
properties? | IUpdateResponse | Properties to set |
Returns
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
completed
• Optional
completed: null
| IPayload
Must be sent once the update handler completes successfully.
Implementation of
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
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
Name | Type | Description |
---|---|---|
properties? | IUpdateResponse | Properties to set |
Returns
UpdateResponse instance
decode
▸ decode(reader
, length?
): UpdateResponse
Decodes an UpdateResponse 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
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
Name | Type | Description |
---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
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
Name | Type | Description |
---|---|---|
message | IUpdateResponse | UpdateResponse message or plain object to encode |
writer? | Writer | Writer 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
Name | Type | Description |
---|---|---|
message | IUpdateResponse | UpdateResponse message or plain object to encode |
writer? | Writer | Writer 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
Name | Type | Description |
---|---|---|
object | Object | Plain object |
Returns
UpdateResponse
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?
): string
Gets the default type url for UpdateResponse
Parameters
Name | Type | Description |
---|---|---|
typeUrlPrefix? | string | your 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
Name | Type | Description |
---|---|---|
message | UpdateResponse | UpdateResponse |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object