UserBonusBatchCreateResult

toloka.client.batch_create_results.UserBonusBatchCreateResult

UserBonusBatchCreateResult(
self,
*,
items: Optional[Dict[str, UserBonus]] = None,
validation_errors: Optional[Dict[str, Dict[str, FieldValidationError]]] = None
)

The result of issuing bonuses for Tolokers.

UserBonusBatchCreateResult is returned by the create_user_bonuses method.

Parameters description

ParametersTypeDescription
itemsOptional[Dict[str, UserBonus]]

A dictionary with created bonuses. The indexes of a create_user_bonuses input list are used as keys in the dictionary.

validation_errorsOptional[Dict[str, Dict[str, FieldValidationError]]]

A dictionary with validation errors. It is filled if the request parameter skip_invalid_items is True.

Examples:

import decimal
bonuses=[
toloka.client.user_bonus.UserBonus(
user_id='fac97860c7929add8048ed2ef63b66fd',
amount=decimal.Decimal('0.50'),
public_title={'EN': 'Perfect job!'},
public_message={'EN': 'You are the best!'},
assignment_id='00001092da--61ef030400c684132d0da0de'
),
]
result = toloka_client.create_user_bonuses(user_bonuses=bonuses, skip_invalid_items=True)
print(result.items['0'].created)

Last updated: August 28, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming