@@ -31,6 +31,24 @@ def __normalize_task_type(self, task_type: str) -> str:
3131 def get (
3232 self , req_options : Optional ["RequestOptions" ] = None , task_type : str = TaskItem .Type .ExtractRefresh
3333 ) -> tuple [list [TaskItem ], PaginationItem ]:
34+ """
35+ Returns information about tasks on the specified site.
36+
37+ REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_jobs_tasks_and_schedules.htm#list_extract_refresh_tasks
38+
39+ Parameters
40+ ----------
41+ req_options : RequestOptions, optional
42+ Options for the request, such as filtering, sorting, and pagination.
43+
44+ task_type : str, optional
45+ The type of task to query. See TaskItem.Type for possible values.
46+
47+ Returns
48+ -------
49+ tuple[list[TaskItem], PaginationItem]
50+
51+ """
3452 if task_type == TaskItem .Type .DataAcceleration :
3553 self .parent_srv .assert_at_least_version ("3.8" , "Data Acceleration Tasks" )
3654
@@ -45,6 +63,20 @@ def get(
4563
4664 @api (version = "2.6" )
4765 def get_by_id (self , task_id : str ) -> TaskItem :
66+ """
67+ Returns information about the specified task.
68+
69+ REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_jobs_tasks_and_schedules.htm#get_extract_refresh_task
70+
71+ Parameters
72+ ----------
73+ task_id : str
74+ The ID of the task to query.
75+
76+ Returns
77+ -------
78+ TaskItem
79+ """
4880 if not task_id :
4981 error = "No Task ID provided"
5082 raise ValueError (error )
@@ -59,6 +91,21 @@ def get_by_id(self, task_id: str) -> TaskItem:
5991
6092 @api (version = "3.19" )
6193 def create (self , extract_item : TaskItem ) -> TaskItem :
94+ """
95+ Creates a custom schedule for an extract refresh on Tableau Cloud. For
96+ Tableau Server, use the Schedules endpoint to create a schedule.
97+
98+ REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#create_cloud_extract_refresh_task
99+
100+ Parameters
101+ ----------
102+ extract_item : TaskItem
103+ The extract refresh task to create.
104+
105+ Returns
106+ -------
107+ TaskItem
108+ """
62109 if not extract_item :
63110 error = "No extract refresh provided"
64111 raise ValueError (error )
@@ -70,6 +117,20 @@ def create(self, extract_item: TaskItem) -> TaskItem:
70117
71118 @api (version = "2.6" )
72119 def run (self , task_item : TaskItem ) -> bytes :
120+ """
121+ Runs the specified extract refresh task.
122+
123+ REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_jobs_tasks_and_schedules.htm#run_extract_refresh_task
124+
125+ Parameters
126+ ----------
127+ task_item : TaskItem
128+ The task to run.
129+
130+ Returns
131+ -------
132+ bytes
133+ """
73134 if not task_item .id :
74135 error = "Task item missing ID."
75136 raise MissingRequiredFieldError (error )
@@ -86,6 +147,23 @@ def run(self, task_item: TaskItem) -> bytes:
86147 # Delete 1 task by id
87148 @api (version = "3.6" )
88149 def delete (self , task_id : str , task_type : str = TaskItem .Type .ExtractRefresh ) -> None :
150+ """
151+ Deletes the specified extract refresh task on Tableau Server or Tableau Cloud.
152+
153+ REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#delete_extract_refresh_task
154+
155+ Parameters
156+ ----------
157+ task_id : str
158+ The ID of the task to delete.
159+
160+ task_type : str, default TaskItem.Type.ExtractRefresh
161+ The type of task to query. See TaskItem.Type for possible values.
162+
163+ Returns
164+ -------
165+ None
166+ """
89167 if task_type == TaskItem .Type .DataAcceleration :
90168 self .parent_srv .assert_at_least_version ("3.8" , "Data Acceleration Tasks" )
91169
0 commit comments