11"""Client presentation methods for projects."""
22
3+ import warnings
34from typing import (
45 Any ,
56 Dict ,
@@ -304,6 +305,7 @@ def update_properties_in_project(
304305 use_honeypot : Optional [bool ] = None ,
305306 metadata_types : Optional [dict ] = None ,
306307 seconds_to_label_before_auto_assign : Optional [int ] = None ,
308+ should_auto_assign : Optional [bool ] = None ,
307309 ) -> Dict [str , Any ]:
308310 """Update properties of a project.
309311
@@ -340,9 +342,8 @@ def update_properties_in_project(
340342 metadata_types: Types of the project metadata.
341343 Should be a `dict` of metadata fields name as keys and metadata types as values.
342344 Currently, possible types are: `string`, `number`
343- seconds_to_label_before_auto_assign: When a user begins to annotate an asset,
344- it automatically gets assigned to them.
345- This ensures the user retains the asset until it is submitted.
345+ seconds_to_label_before_auto_assign: DEPRECATED, use `should_auto_assign` instead.
346+ should_auto_assign: If `True`, assets are automatically assigned to users when they start annotating.
346347
347348 Returns:
348349 A dict with the changed properties which indicates if the mutation was successful,
@@ -369,6 +370,14 @@ def update_properties_in_project(
369370 Not providing a type for a metadata field or providing an unsupported one
370371 will default to the `string` type.
371372 """
373+ if seconds_to_label_before_auto_assign is not None :
374+ warnings .warn (
375+ "seconds_to_label_before_auto_assign is going to be deprecated. Please use"
376+ " `should_auto_assign` field instead to auto assign assets" ,
377+ DeprecationWarning ,
378+ stacklevel = 1 ,
379+ )
380+
372381 return ProjectUseCases (self .kili_api_gateway ).update_properties_in_project (
373382 ProjectId (project_id ),
374383 can_navigate_between_assets = can_navigate_between_assets ,
@@ -391,6 +400,7 @@ def update_properties_in_project(
391400 use_honeypot = use_honeypot ,
392401 title = title ,
393402 metadata_types = metadata_types ,
403+ should_auto_assign = should_auto_assign ,
394404 seconds_to_label_before_auto_assign = seconds_to_label_before_auto_assign ,
395405 )
396406
0 commit comments