|
23 | 23 | from lib.app.interface.types import AnnotationStatuses |
24 | 24 | from lib.app.interface.types import AnnotationType |
25 | 25 | from lib.app.interface.types import AnnotatorRole |
| 26 | +from lib.app.interface.types import ApprovalStatuses |
26 | 27 | from lib.app.interface.types import AttachmentArg |
27 | 28 | from lib.app.interface.types import AttachmentDict |
28 | 29 | from lib.app.interface.types import ClassType |
@@ -2332,7 +2333,7 @@ def search_items( |
2332 | 2333 | ♦ “QualityCheck” \n |
2333 | 2334 | ♦ “Returned” \n |
2334 | 2335 | ♦ “Completed” \n |
2335 | | - ♦ “Skippe |
| 2336 | + ♦ “Skip” \n |
2336 | 2337 | :type annotation_status: str |
2337 | 2338 |
|
2338 | 2339 | :param annotator_email: returns those items’ names that are assigned to the specified annotator. |
@@ -2569,13 +2570,13 @@ def set_annotation_statuses( |
2569 | 2570 | :param project: project name or folder path (e.g., “project1/folder1”). |
2570 | 2571 | :type project: str |
2571 | 2572 |
|
2572 | | - :param annotation_status: annotation status to set, should be one of. |
2573 | | - “NotStarted” |
2574 | | - “InProgress” |
2575 | | - “QualityCheck” |
2576 | | - “Returned” |
2577 | | - “Completed” |
2578 | | - “Skipped” |
| 2573 | + :param annotation_status: annotation status to set, should be one of. \n |
| 2574 | + ♦ “NotStarted” \n |
| 2575 | + ♦ “InProgress” \n |
| 2576 | + ♦ “QualityCheck” \n |
| 2577 | + ♦ “Returned” \n |
| 2578 | + ♦ “Completed” \n |
| 2579 | + ♦ “Skipped” \n |
2579 | 2580 | :type annotation_status: str |
2580 | 2581 |
|
2581 | 2582 | :param items: item names to set the mentioned status for. If None, all the items in the project will be used. |
@@ -3021,3 +3022,32 @@ def add_items_to_subset( |
3021 | 3022 |
|
3022 | 3023 | return response.data |
3023 | 3024 |
|
| 3025 | + def set_approval_statuses( |
| 3026 | + self, |
| 3027 | + project: NotEmptyStr, |
| 3028 | + approval_status: Union[ApprovalStatuses, None], |
| 3029 | + items: Optional[List[NotEmptyStr]] = None, |
| 3030 | + ): |
| 3031 | + """Sets annotation statuses of items |
| 3032 | +
|
| 3033 | + :param project: project name or folder path (e.g., “project1/folder1”). |
| 3034 | + :type project: str |
| 3035 | +
|
| 3036 | + :param approval_status: approval status to set, should be one of. \n |
| 3037 | + ♦ None \n |
| 3038 | + ♦ “Approved” \n |
| 3039 | + ♦ “Disapproved” \n |
| 3040 | + :type approval_status: str |
| 3041 | +
|
| 3042 | + :param items: item names to set the mentioned status for. If None, all the items in the project will be used. |
| 3043 | + :type items: list of strs |
| 3044 | + """ |
| 3045 | + project, folder = self.controller.get_project_folder_by_path(project) |
| 3046 | + response = self.controller.items.set_approval_statuses( |
| 3047 | + project=project, |
| 3048 | + folder=folder, |
| 3049 | + approval_status=approval_status, |
| 3050 | + item_names=items, |
| 3051 | + ) |
| 3052 | + if response.errors: |
| 3053 | + raise AppException(response.errors) |
0 commit comments