@@ -461,6 +461,16 @@ def list_users(self, *, include: List[Literal["custom_fields"]] = None, **filter
461461 def pause_user_activity (
462462 self , pk : Union [int , str ], projects : Union [List [int ], List [str ], Literal ["*" ]]
463463 ):
464+ """
465+ Block the team contributor from requesting items from the projects.
466+
467+ :param pk: The email address or user ID of the team contributor.
468+ :type pk: str or int
469+
470+ :param projects: A list of project names or IDs from which the user should be blocked.
471+ The special value "*" means block access to all projects
472+ :type projects: Union[List[int], List[str], Literal["*"]]
473+ """
464474 user = self .controller .work_management .get_user_metadata (pk = pk )
465475 if user .role is not WMUserTypeEnum .Contributor :
466476 raise AppException ("User must have a contributor role to pause activity." )
@@ -474,6 +484,16 @@ def pause_user_activity(
474484 def resume_user_activity (
475485 self , pk : Union [int , str ], projects : Union [List [int ], List [str ], Literal ["*" ]]
476486 ):
487+ """
488+ Resume the team contributor from requesting items from the projects.
489+
490+ :param pk: The email address or user ID of the team contributor.
491+ :type pk: str or int
492+
493+ :param projects: A list of project names or IDs from which the user should be resumed.
494+ The special value "*" means resume access to all projects
495+ :type projects: Union[List[int], List[str], Literal["*"]]
496+ """
477497 user = self .controller .work_management .get_user_metadata (pk = pk )
478498 if user .role is not WMUserTypeEnum .Contributor :
479499 raise AppException ("User must have a contributor role to resume activity." )
@@ -2919,32 +2939,80 @@ def attach_items_from_integrated_storage(
29192939 project : NotEmptyStr ,
29202940 integration : Union [NotEmptyStr , IntegrationEntity ],
29212941 folder_path : Optional [NotEmptyStr ] = None ,
2942+ * ,
2943+ query : Optional [NotEmptyStr ] = None ,
2944+ item_name_column : Optional [NotEmptyStr ] = None ,
2945+ custom_item_name : Optional [NotEmptyStr ] = None ,
2946+ component_mapping : Optional [Dict [str , str ]] = None ,
29222947 ):
2923- """Link images from integrated external storage to SuperAnnotate.
2948+ """Link images from integrated external storage to SuperAnnotate from AWS, GCP, Azure, Databricks .
29242949
29252950 :param project: project name or folder path where items should be attached (e.g., “project1/folder1”).
29262951 :type project: str
29272952
2928- :param integration: existing integration name or metadata dict to pull items from.
2929- Mandatory keys in integration metadata’s dict is “name”.
2953+ :param integration: The existing integration name or metadata dict to pull items from.
2954+ Mandatory keys in integration metadata’s dict is “name”.
29302955 :type integration: str or dict
29312956
29322957 :param folder_path: Points to an exact folder/directory within given storage.
2933- If None, items are fetched from the root directory.
2958+ If None, items are fetched from the root directory.
29342959 :type folder_path: str
2960+
2961+ :param query: (Only for Databricks). The SQL query to retrieve specific columns from Databricks.
2962+ If provided, the function will execute the query and use the results for mapping and uploading.
2963+ :type query: Optional[str]
2964+
2965+ :param item_name_column: (Only for Databricks). The column name from the SQL query whose values
2966+ will be used as item names. If this is provided, custom_item_name cannot be used.
2967+ The column must exist in the query result.
2968+ :type item_name_column: Optional[str]
2969+
2970+ :param custom_item_name: (Only for Databricks). A manually defined prefix for item names.
2971+ A random 10-character suffix will be appended to ensure uniqueness.
2972+ If this is provided, item_name_column cannot be used.
2973+ :type custom_item_name: Optional[str]
2974+
2975+ :param component_mapping: (Only for Databricks). A dictionary mapping Databricks
2976+ columns to SuperAnnotate component IDs.
2977+ :type component_mapping: Optional[dict]
2978+
2979+
2980+ Request Example:
2981+ ::
2982+
2983+ client.attach_items_from_integrated_storage(
2984+ project="project_name",
2985+ integration="databricks_integration",
2986+ query="SELECT * FROM integration_data LIMIT 10",
2987+ item_name_column="prompt",
2988+ component_mapping={
2989+ "category": "_item_category",
2990+ "prompt_id": "id",
2991+ "prompt": "prompt"
2992+ }
2993+ )
2994+
29352995 """
29362996 project , folder = self .controller .get_project_folder_by_path (project )
29372997 _integration = None
29382998 if isinstance (integration , str ):
29392999 integration = IntegrationEntity (name = integration )
29403000 for i in self .controller .integrations .list ().data :
2941- if integration .name == i .name :
3001+ if integration .name . lower () == i .name . lower () :
29423002 _integration = i
29433003 break
29443004 else :
29453005 raise AppException ("Integration not found." )
3006+
29463007 response = self .controller .integrations .attach_items (
2947- project , folder , _integration , folder_path
3008+ project = project ,
3009+ folder = folder ,
3010+ integration = _integration ,
3011+ folder_path = folder_path ,
3012+ query = query ,
3013+ item_name_column = item_name_column ,
3014+ custom_item_name = custom_item_name ,
3015+ component_mapping = component_mapping ,
29483016 )
29493017 if response .errors :
29503018 raise AppException (response .errors )
@@ -3593,7 +3661,7 @@ def copy_items(
35933661 "skip" , "replace" , "replace_annotations_only"
35943662 ] = "skip" ,
35953663 ):
3596- """Copy images in bulk between folders in a project
3664+ """Copy items in bulk between folders in a project
35973665
35983666 :param source: project name (root) or folder path to pick items from (e.g., “project1/folder1”).
35993667 :type source: str
@@ -3657,7 +3725,7 @@ def move_items(
36573725 "skip" , "replace" , "replace_annotations_only"
36583726 ] = "skip" ,
36593727 ):
3660- """Move images in bulk between folders in a project
3728+ """Move items in bulk between folders in a project
36613729
36623730 :param source: project name (root) or folder path to pick items from (e.g., “project1/folder1”).
36633731 :type source: str
0 commit comments