Skip to content

Commit

Permalink
feat: add support for offset and limit to label elements
Browse files Browse the repository at this point in the history
Add support for paging to the label elements API.

JIRA: CQ-764
risk: low
  • Loading branch information
no23reason committed Sep 11, 2024
1 parent 44773c8 commit 3e0429d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gooddata-sdk/gooddata_sdk/catalog/workspace/content_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,8 @@ def get_label_elements(
validate_by: Optional[list[CatalogValidateByItem]] = None,
exact_filter: Optional[list[str]] = None,
filter_by: Optional[CatalogFilterBy] = None,
offset: Optional[int] = None,
limit: Optional[int] = None,
) -> list[str]:
"""
Get existing values for a label.
Expand All @@ -588,6 +590,10 @@ def get_label_elements(
filter_by (Optional[CatalogFilterBy]):
Optional parameter specifying which label is used for filtering - primary or requested.
If omitted the server will use the default value of "REQUESTED"
offset (Optional[int]):
Optional parameter specifying the offset for the returned values.
limit (Optional[int]):
Optional parameter specifying the limit for the returned values.
Returns:
list of label values
"""
Expand All @@ -613,5 +619,7 @@ def get_label_elements(
request.filter_by = filter_by.to_api()

# TODO - fix return type of Paging.next in Backend + add support for this API to SDK
values = self._actions_api.compute_label_elements_post(workspace_id, request, _check_return_type=False)
values = self._actions_api.compute_label_elements_post(
workspace_id, request, offset=offset, limit=limit, _check_return_type=False
)
return [v["title"] for v in values["elements"]]

0 comments on commit 3e0429d

Please sign in to comment.