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.
Implements
Constructors
constructor
• new Cancellation(properties?): Cancellation
Constructs a new Cancellation.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | ICancellation | Properties to set |
Returns
Properties
failure
• Optional failure: null | IFailure
Cancellation failure.
Implementation of
Methods
toJSON
▸ toJSON(): Object
Converts this Cancellation to JSON.
Returns
Object
JSON object
create
▸ create(properties?): Cancellation
Creates a new Cancellation instance using the specified properties.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | ICancellation | Properties to set |
Returns
Cancellation instance
decode
▸ decode(reader, length?): Cancellation
Decodes a Cancellation 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
Cancellation
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited
▸ decodeDelimited(reader): Cancellation
Decodes a Cancellation message from the specified reader or buffer, length delimited.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
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
| Name | Type | Description |
|---|---|---|
message | ICancellation | Cancellation message or plain object to encode |
writer? | Writer | Writer 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
| Name | Type | Description |
|---|---|---|
message | ICancellation | Cancellation message or plain object to encode |
writer? | Writer | Writer 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
| Name | Type | Description |
|---|---|---|
object | Object | Plain object |
Returns
Cancellation
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?): string
Gets the default type url for Cancellation
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 a Cancellation message. Also converts values to other types if specified.
Parameters
| Name | Type | Description |
|---|---|---|
message | Cancellation | Cancellation |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object