1212from gooddata_sdk .catalog .catalog_service_base import CatalogServiceBase
1313from gooddata_sdk .catalog .data_source .validation .data_source import DataSourceValidator
1414from gooddata_sdk .catalog .depends_on import CatalogDependsOn , CatalogDependsOnDateFilter
15+ from gooddata_sdk .catalog .filter_by import CatalogFilterBy
1516from gooddata_sdk .catalog .types import ValidObjects
1617from gooddata_sdk .catalog .validate_by_item import CatalogValidateByItem
1718from gooddata_sdk .catalog .workspace .declarative_model .workspace .analytics_model .analytics_model import (
@@ -564,6 +565,8 @@ def get_label_elements(
564565 label_id : LabelElementsInputType ,
565566 depends_on : Optional [List [DependsOnItem ]] = None ,
566567 validate_by : Optional [List [CatalogValidateByItem ]] = None ,
568+ exact_filter : Optional [List [str ]] = None ,
569+ filter_by : Optional [CatalogFilterBy ] = None ,
567570 ) -> List [str ]:
568571 """
569572 Get existing values for a label.
@@ -580,6 +583,11 @@ def get_label_elements(
580583 Optional parameter specifying dependencies on other labels or date filters.
581584 validate_by (Optional[List[CatalogValidateByItem]]):
582585 Optional parameter specifying validation metrics, attributes, labels or facts.
586+ exact_filter (Optional[List[str]]):
587+ Optional parameter specifying exact filter values.
588+ filter_by (Optional[CatalogFilterBy]):
589+ Optional parameter specifying which label is used for filtering - primary or requested.
590+ If omitted the server will use the default value of "REQUESTED"
583591 Returns:
584592 list of label values
585593 """
@@ -597,6 +605,13 @@ def get_label_elements(
597605 request = ElementsRequest (
598606 label = label_id , depends_on = [d .to_api () for d in depends_on ], validate_by = [v .to_api () for v in validate_by ]
599607 )
608+
609+ if exact_filter is not None :
610+ request .exact_filter = exact_filter
611+
612+ if filter_by is not None :
613+ request .filter_by = filter_by .to_api ()
614+
600615 # TODO - fix return type of Paging.next in Backend + add support for this API to SDK
601616 values = self ._actions_api .compute_label_elements_post (workspace_id , request , _check_return_type = False )
602617 return [v ["title" ] for v in values ["elements" ]]
0 commit comments