toloka.client.TolokaClient.get_user_bonuses
| Source code
Finds all Tolokers' bonuses that match certain rules and returns them in an iterable object
get_user_bonuses
returns a generator. You can iterate over all found Tolokers' bonuses using the generator. Several requests to the Toloka server are possible while iterating.
If you need to sort bonuses use the find_user_bonuses method.
Parameters | Type | Description |
---|---|---|
user_id | Optional[str] | The ID of a Toloker. |
assignment_id | Optional[str] | The ID of an assignment a bonus was granted for. |
private_comment | Optional[str] | Bonuses with specified comment. |
id_lt | Optional[str] | Bonuses with IDs less than the specified value. |
id_lte | Optional[str] | Bonuses with IDs less than or equal to the specified value. |
id_gt | Optional[str] | Bonuses with IDs greater than the specified value. |
id_gte | Optional[str] | Bonuses with IDs greater than or equal to the specified value. |
created_lt | Optional[datetime] | Bonuses given before the specified date. |
created_lte | Optional[datetime] | Bonuses given before or on the specified date. |
created_gt | Optional[datetime] | Bonuses given after the specified date. |
created_gte | Optional[datetime] | Bonuses given after or on the specified date. |
batch_size | Optional[int] | A limit of items returned by each request to Toloka. The maximum allowed value: 300. |
Yields:
The next matching Toloker's bonus.
Yield type:
Generator[UserBonus, None, None]
Examples:
bonuses = list(toloka_client.get_user_bonuses(created_lt='2023-06-01T00:00:00'))
Last updated: August 28, 2023