toloka.client.operations.Operation
| Source code
Operation( self, *, id: Optional[str] = None, status: Union[Status, str, None] = None, submitted: Optional[datetime] = None, parameters: Optional[Parameters] = None, started: Optional[datetime] = None, finished: Optional[datetime] = None, progress: Optional[int] = None, details: Optional[Any] = None)
A base class for Toloka operations.
Some API requests start asynchronous operations in Toloka. Classes derived from Operation
are used to track them.
The examples of asynchronous operations are opening a pool, archiving a project, loading multiple tasks.
Parameters | Type | Description |
---|---|---|
id | Optional[str] | The ID of the operation. |
status | Optional[Status] | The status of the operation. |
submitted | Optional[datetime] | The UTC date and time when the operation was requested. |
parameters | Optional[Parameters] | Parameters of the request that started the operation. |
started | Optional[datetime] | The UTC date and time when the operation started. |
finished | Optional[datetime] | The UTC date and time when the operation finished. |
progress | Optional[int] | The operation progress as a percentage. |
details | Optional[Any] | Details of the operation completion. |
Method | Description |
---|---|
is_completed | Checks whether the operation is completed either successfully or not. |
raise_on_fail | Raises the FailedOperation exception if the operation status is FAIL . Otherwise does nothing. |
Last updated: August 28, 2023