File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -64,18 +64,22 @@ def get_task(self, task_id: str) -> Task:
64
64
endpoint = f"task/{ task_id } "
65
65
return Task (self .api .get_request (endpoint ), self )
66
66
67
- def cancel_task (self , task_id : str ) -> Task :
67
+ def cancel_task (self , task_id : str , clear_unique_id : bool ) -> Task :
68
68
"""Cancels a task and returns the associated task.
69
69
Raises a ScaleException if it has already been canceled.
70
70
71
71
Args:
72
72
task_id (str):
73
73
Task id
74
-
74
+ clear_unique_id (boolean):
75
+ Option to clear unique id when the task is deleted
75
76
Returns:
76
77
Task
77
78
"""
78
- endpoint = f"task/{ task_id } /cancel"
79
+ if clear_unique_id :
80
+ endpoint = f"task/{ task_id } /cancel?clear_unique_id=true"
81
+ else :
82
+ endpoint = f"task/{ task_id } /cancel"
79
83
return Task (self .api .post_request (endpoint ), self )
80
84
81
85
def tasks (self , ** kwargs ) -> Tasklist :
You can’t perform that action at this time.
0 commit comments