OperationResult Class

OperationResult.

The result of an Entity operation.

Instantiate an OperationResult.

Constructor

OperationResult(is_error: bool, duration: int, result: str | None = None)

Parameters

Name Description
is_error
Required

Whether or not the operation resulted in an exception.

duration
Required
int

How long the operation took, in milliseconds.

result
<xref:Optional>[str]

The operation result. Defaults to None.

Default value: None

Methods

to_json

Represent OperationResult as a JSON-serializable Dict.

to_json

Represent OperationResult as a JSON-serializable Dict.

to_json() -> Dict[str, Any]

Returns

Type Description

A JSON-serializable Dict of the OperationResult

Attributes

duration

Get the duration of this operation.

Returns

Type Description
int

The duration of this operation, in milliseconds

is_error

Determine if the operation resulted in an error.

Returns

Type Description

True if the operation resulted in error. Otherwise False.

result

Get the operation's result.

Returns

Type Description
Any

The operation's result