Skip to content

Commit 174a0ab

Browse files
committed
docs: address fresh-eyes review on Favorites docstrings
- Class docstring: add missing "collections" FavoriteType (7, not 6). - add_favorite: drop misleading #add_workbook_to_favorites anchor on polymorphic method; link to Favorites Methods page root. - add_favorite_metric: add REST API link (#add_metric_to_favorites). - delete_favorite: add REST API link; polymorphic, so page root. - delete_favorite_metric: add REST API link; no per-type anchor exists, so page root. - delete_favorite_flow: fix anchor drift (#delete_flow_from_favorites -> #ref_delete_flow_from_favorites).
1 parent c67b9a3 commit 174a0ab

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

‎tableauserverclient/server/endpoint/favorites_endpoint.py‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
class Favorites(Endpoint):
2020
"""Get, add, and remove favorites for a user.
2121
22-
Favorites can be workbooks, views, datasources, flows, projects, or metrics.
23-
Retrieved favorites are stored on the target ``UserItem`` object as a
24-
dictionary keyed by content type (e.g. ``"workbooks"``, ``"views"``,
25-
``"datasources"``, ``"flows"``, ``"projects"``, ``"metrics"``), where
26-
each value is a list of the corresponding item objects.
22+
Favorites can be workbooks, views, datasources, flows, projects, metrics,
23+
or collections. Retrieved favorites are stored on the target ``UserItem``
24+
object as a dictionary keyed by content type (e.g. ``"workbooks"``,
25+
``"views"``, ``"datasources"``, ``"flows"``, ``"projects"``, ``"metrics"``,
26+
``"collections"``), where each value is a list of the corresponding item
27+
objects.
2728
2829
REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_favorites.htm
2930
"""
@@ -77,7 +78,7 @@ def add_favorite(self, user_item: UserItem, content_type: str, item: TableauItem
7778
etc.) exist for each individual content type; this method is the
7879
polymorphic entry point.
7980
80-
REST API: `Add to Favorites <https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_favorites.htm#add_workbook_to_favorites>`_
81+
REST API: `Favorites Methods <https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_favorites.htm>`_
8182
8283
Parameters
8384
----------
@@ -222,6 +223,8 @@ def add_favorite_flow(self, user_item: UserItem, flow_item: FlowItem) -> None:
222223
def add_favorite_metric(self, user_item: UserItem, metric_item: MetricItem) -> None:
223224
"""Add a metric to the user's favorites.
224225
226+
REST API: `Add Metric to Favorites <https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_favorites.htm#add_metric_to_favorites>`_
227+
225228
Parameters
226229
----------
227230
user_item : UserItem
@@ -257,6 +260,8 @@ def delete_favorite(self, user_item: UserItem, content_type: Resource, item: Tab
257260
``delete_favorite_view``, etc.) exist for each individual content
258261
type; this method is the polymorphic entry point.
259262
263+
REST API: `Favorites Methods <https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_favorites.htm>`_
264+
260265
Parameters
261266
----------
262267
user_item : UserItem
@@ -374,7 +379,7 @@ def delete_favorite_project(self, user_item: UserItem, project_item: ProjectItem
374379
def delete_favorite_flow(self, user_item: UserItem, flow_item: FlowItem) -> None:
375380
"""Remove a flow from the user's favorites.
376381
377-
REST API: `Delete Flow from Favorites <https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_favorites.htm#delete_flow_from_favorites>`_
382+
REST API: `Delete Flow from Favorites <https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_favorites.htm#ref_delete_flow_from_favorites>`_
378383
379384
Parameters
380385
----------
@@ -396,6 +401,8 @@ def delete_favorite_flow(self, user_item: UserItem, flow_item: FlowItem) -> None
396401
def delete_favorite_metric(self, user_item: UserItem, metric_item: MetricItem) -> None:
397402
"""Remove a metric from the user's favorites.
398403
404+
REST API: `Favorites Methods <https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_favorites.htm>`_
405+
399406
Parameters
400407
----------
401408
user_item : UserItem

0 commit comments

Comments
 (0)