Skip to main content

Class: Cancellation

coresdk.activity_result.Cancellation

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

Implements#

Constructors#

constructor#

new Cancellation(properties?)

Constructs a new Cancellation.

Parameters#

NameType
properties?ICancellation

Properties#

failure#

Optional failure: null | IFailure

Cancellation failure.

Implementation of#

ICancellation.failure

Methods#

toJSON#

toJSON(): Object

Converts this Cancellation to JSON.

Returns#

Object

JSON object


decode#

Static decode(reader, length?): Cancellation

Decodes a Cancellation message from the specified reader or buffer.

throws {Error} If the payload is not a reader or valid buffer

throws {$protobuf.util.ProtocolError} If required fields are missing

Parameters#

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?number-

Returns#

Cancellation

Cancellation


decodeDelimited#

Static decodeDelimited(reader): Cancellation

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

throws {Error} If the payload is not a reader or valid buffer

throws {$protobuf.util.ProtocolError} If required fields are missing

Parameters#

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns#

Cancellation

Cancellation


encode#

Static encode(message, writer?): Writer

Encodes the specified Cancellation message. Does not implicitly {@link coresdk.activity_result.Cancellation.verify|verify} messages.

Parameters#

NameTypeDescription
messageICancellationCancellation message or plain object to encode
writer?Writer-

Returns#

Writer

Writer


encodeDelimited#

Static encodeDelimited(message, writer?): Writer

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

Parameters#

NameTypeDescription
messageICancellationCancellation message or plain object to encode
writer?Writer-

Returns#

Writer

Writer


fromObject#

Static 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#

Static toObject(message, options?): Object

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

Parameters#

NameTypeDescription
messageCancellationCancellation
options?IConversionOptions-

Returns#

Object

Plain object