Skip to content

Commit 045d458

Browse files
committed
Update docs
1 parent 9c0abb9 commit 045d458

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

docs/source/api_reference/api_team.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ Team
1010
.. automethod:: superannotate.SAClient.get_user_metadata
1111
.. automethod:: superannotate.SAClient.set_user_custom_field
1212
.. automethod:: superannotate.SAClient.list_users
13+
.. automethod:: superannotate.SAClient.pause_user_activity
14+
.. automethod:: superannotate.SAClient.resume_user_activity

src/superannotate/lib/app/interface/sdk_interface.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.")

src/superannotate/lib/infrastructure/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ def sync(self, project: ProjectEntity):
149149
self._K_V_map[project.id] = {
150150
"role_name_id_map": {
151151
**{role["role"]["name"]: role["role_id"] for role in roles},
152-
"ProjectAdmin": 3
152+
"ProjectAdmin": 3,
153153
},
154154
"role_id_name_map": {
155155
**{role["role_id"]: role["role"]["name"] for role in roles},
156-
3: "ProjectAdmin"
156+
3: "ProjectAdmin",
157157
},
158158
}
159159
self._update_cache_timestamp(project.id)

0 commit comments

Comments
 (0)