find_user_restrictions

toloka.client.TolokaClient.find_user_restrictions | Source code

Finds Toloker restrictions that match certain criteria.

The number of returned restrictions is limited. To find remaining restrictions call find_user_restrictions with updated search criteria.

To iterate over all matching Toloker restrictions you may use the get_user_restrictions method.

Parameters description

ParametersTypeDescription
scopeOptional[UserRestriction.Scope]

The scope of a restriction. Refer to the UserRestriction.Scope page for more information on the available scope values.

user_idOptional[str]

The Toloker's ID.

project_idOptional[str]

The ID of a project with restricted access.

pool_idOptional[str]

The ID of a pool with restricted access.

id_ltOptional[str]

Restrictions with IDs less than the specified value.

id_lteOptional[str]

Restrictions with IDs less than or equal to the specified value.

id_gtOptional[str]

Restrictions with IDs greater than the specified value.

id_gteOptional[str]

Restrictions with IDs greater than or equal to the specified value.

created_ltOptional[datetime]

Restrictions created before the specified date.

created_lteOptional[datetime]

Restrictions created before or on the specified date.

created_gtOptional[datetime]

Restrictions created after the specified date.

created_gteOptional[datetime]

Restrictions created after or on the specified date.

sortUnion[List[str], UserRestrictionSortItems, None]

Sorting options. Default: None.

limitOptional[int]

Returned Toloker restrictions limit. The maximum allowed value: 500.

  • Returns:

    Found Toloker restrictions and a flag showing whether there are more matching restrictions exceeding the limit.

  • Return type:

    UserRestrictionSearchResult

Examples:

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

If there are restrictions exceeding the limit, then find_result.has_more is set to True.

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