Skip to main content

Class: Cancellation

coresdk.activity_result.Cancellation

Used to report cancellation from both Core and Lang. When Lang reports a cancelled activity, it must put a CancelledFailure in the failure field. When Core reports a cancelled activity, it must put an ActivityFailure with CancelledFailure as the cause in the failure field.

Properties​

failure​

• Optional failure: null | $Properties

Cancellation failure.

Methods​

toJSON​

▸ toJSON(): Object

Converts this Cancellation to JSON.

Returns​

Object

JSON object


create​

▸ create(properties?): Cancellation & $Shape

Creates a new Cancellation instance using the specified properties.

Parameters​

NameTypeDescription
properties?$ShapeProperties to set

Returns​

Cancellation & $Shape

Cancellation instance

▸ create(properties?): Cancellation

Parameters​

NameType
properties?$Properties

Returns​

Cancellation


decode​

▸ decode(reader, length?): Cancellation & $Shape

Decodes a Cancellation message from the specified reader or buffer.

Parameters​

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

Returns​

Cancellation & $Shape

Cancellation

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited​

▸ decodeDelimited(reader): Cancellation & $Shape

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

Parameters​

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns​

Cancellation & $Shape

Cancellation

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

Parameters​

NameTypeDescription
message$PropertiesCancellation message or plain object to encode
writer?WriterWriter to encode to

Returns​

Writer

Writer


encodeDelimited​

▸ encodeDelimited(message, writer?): Writer

Encodes the specified Cancellation message, length delimited. Does not implicitly coresdk.activity_result.Cancellation.verify|verify messages.

Parameters​

NameTypeDescription
message$PropertiesCancellation message or plain object to encode
writer?WriterWriter to encode to

Returns​

Writer

Writer


fromObject​

▸ fromObject(object): Cancellation

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

Parameters​

NameTypeDescription
objectObjectPlain object

Returns​

Cancellation

Cancellation


toObject​

▸ toObject(message, options?): Object

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

Parameters​

NameTypeDescription
messageCancellationCancellation
options?IConversionOptionsConversion options

Returns​

Object

Plain object