Project Workflow module
Client presentation methods for project workflow.
Source code in kili/presentation/client/project_workflow.py
class ProjectWorkflowClientMethods(BaseClientMethods):
"""Client presentation methods for project workflow."""
@typechecked
def update_project_workflow(
self,
project_id: str,
enforce_step_separation: Optional[bool] = None,
create_steps: Optional[List[WorkflowStepCreate]] = None,
update_steps: Optional[List[WorkflowStepUpdate]] = None,
delete_steps: Optional[List[str]] = None,
) -> Dict[str, Any]:
"""Update properties of a project workflow.
Args:
project_id: Id of the project.
enforce_step_separation: Prevents the same user from being assigned to
multiple steps in the workflow for a same asset,
ensuring independent review and labeling processes
create_steps: List of steps to create in the project workflow.
update_steps: List of steps to update in the project workflow.
delete_steps: List of step IDs to delete from the project workflow.
Returns:
A dict with the changed properties which indicates if the mutation was successful,
else an error message.
"""
return ProjectWorkflowUseCases(self.kili_api_gateway).update_project_workflow(
project_id=ProjectId(project_id),
enforce_step_separation=enforce_step_separation,
create_steps=create_steps,
update_steps=update_steps,
delete_steps=delete_steps,
)
@typechecked
def get_steps(
self,
project_id: str,
) -> List[Dict[str, Any]]:
"""Get steps in a project workflow.
Args:
project_id: Id of the project.
Returns:
A dict with the steps of the project workflow.
"""
return ProjectWorkflowUseCases(self.kili_api_gateway).get_steps(
project_id=ProjectId(project_id),
)
get_steps(self, project_id)
Get steps in a project workflow.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_id |
str |
Id of the project. |
required |
Returns:
Type | Description |
---|---|
List[Dict[str, Any]] |
A dict with the steps of the project workflow. |
Source code in kili/presentation/client/project_workflow.py
def get_steps(
self,
project_id: str,
) -> List[Dict[str, Any]]:
"""Get steps in a project workflow.
Args:
project_id: Id of the project.
Returns:
A dict with the steps of the project workflow.
"""
return ProjectWorkflowUseCases(self.kili_api_gateway).get_steps(
project_id=ProjectId(project_id),
)
update_project_workflow(self, project_id, enforce_step_separation=None, create_steps=None, update_steps=None, delete_steps=None)
Update properties of a project workflow.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_id |
str |
Id of the project. |
required |
enforce_step_separation |
Optional[bool] |
Prevents the same user from being assigned to multiple steps in the workflow for a same asset, ensuring independent review and labeling processes |
None |
create_steps |
Optional[List[kili.domain.project.WorkflowStepCreate]] |
List of steps to create in the project workflow. |
None |
update_steps |
Optional[List[kili.domain.project.WorkflowStepUpdate]] |
List of steps to update in the project workflow. |
None |
delete_steps |
Optional[List[str]] |
List of step IDs to delete from the project workflow. |
None |
Returns:
Type | Description |
---|---|
Dict[str, Any] |
A dict with the changed properties which indicates if the mutation was successful, else an error message. |
Source code in kili/presentation/client/project_workflow.py
def update_project_workflow(
self,
project_id: str,
enforce_step_separation: Optional[bool] = None,
create_steps: Optional[List[WorkflowStepCreate]] = None,
update_steps: Optional[List[WorkflowStepUpdate]] = None,
delete_steps: Optional[List[str]] = None,
) -> Dict[str, Any]:
"""Update properties of a project workflow.
Args:
project_id: Id of the project.
enforce_step_separation: Prevents the same user from being assigned to
multiple steps in the workflow for a same asset,
ensuring independent review and labeling processes
create_steps: List of steps to create in the project workflow.
update_steps: List of steps to update in the project workflow.
delete_steps: List of step IDs to delete from the project workflow.
Returns:
A dict with the changed properties which indicates if the mutation was successful,
else an error message.
"""
return ProjectWorkflowUseCases(self.kili_api_gateway).update_project_workflow(
project_id=ProjectId(project_id),
enforce_step_separation=enforce_step_separation,
create_steps=create_steps,
update_steps=update_steps,
delete_steps=delete_steps,
)