Toloka documentation

get_user_restrictions

toloka.client.TolokaClient.get_user_restrictions

Finds all user restrictions that match certain rules and returns them in an iterable object

Unlike find_user_restrictions, returns generator. Does not sort user restrictions. While iterating over the result, several requests to the Toloka server is possible.

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.

  • Yields:

    The next object corresponding to the request parameters.

  • Yield type:

    Generator[UserRestriction, None, None]

Examples:

results_list = [restriction for restriction in toloka_client.get_user_restrictions(scope='ALL_PROJECTS')]