Toloka documentation

find_user_restrictions

toloka.client.TolokaClient.find_user_restrictions

Finds all user restrictions that match certain rules

As a result, it returns an object that contains the first part of the found user restrictions and whether there are any more results. It is better to use the "get_user_restriction" method, they allow to iterate trought all results and not just the first output.

Parameters Description

Parameters Type Description
scope Optional[UserRestriction.Scope]

The scope of the ban

  • ALL_PROJECTS
  • PROJECT
  • POOL

user_id Optional[str]

Performer ID.

project_id Optional[str]

The ID of the project that is blocked.

pool_id Optional[str]

The ID of the pool that is blocked.

id_lt Optional[str]

Bans with an ID less than the specified value.

id_lte Optional[str]

Bans with an ID less than or equal to the specified value.

id_gt Optional[str]

Bans with an ID greater than the specified value.

id_gte Optional[str]

Bans with an ID greater than or equal to the specified value.

created_lt Optional[datetime]

Bans created before the specified date.

created_lte Optional[datetime]

Bans created before or on the specified date.

created_gt Optional[datetime]

Bans created after the specified date.

created_gte Optional[datetime]

Bans created after or on the specified date.

sort Union[List[str], UserRestrictionSortItems, None]

How to sort result. Defaults to None.

limit Optional[int]

Limit on the number of results returned.

Examples:

toloka_client.find_user_restrictions(sort=['-created', '-id'], limit=10)

If method finds more objects than custom or system limit allows to operate, it will also show an indicator has_more=True.