diff --git a/gooddata-sdk/gooddata_sdk/__init__.py b/gooddata-sdk/gooddata_sdk/__init__.py index 248e866a4..e2358f71e 100644 --- a/gooddata-sdk/gooddata_sdk/__init__.py +++ b/gooddata-sdk/gooddata_sdk/__init__.py @@ -71,6 +71,7 @@ from gooddata_sdk.catalog.identifier import ( CatalogAssigneeIdentifier, CatalogDatasetWorkspaceDataFilterIdentifier, + CatalogDeclarativeAnalyticalDashboardIdentifier, CatalogExportDefinitionIdentifier, CatalogNotificationChannelIdentifier, CatalogUserIdentifier, @@ -175,6 +176,7 @@ CatalogDeclarativeModel, ) from gooddata_sdk.catalog.workspace.declarative_model.workspace.workspace import ( + CatalogDeclarativeFilterView, CatalogDeclarativeUserDataFilter, CatalogDeclarativeUserDataFilters, CatalogDeclarativeWorkspace, diff --git a/gooddata-sdk/gooddata_sdk/catalog/identifier.py b/gooddata-sdk/gooddata_sdk/catalog/identifier.py index 9de0a43ac..5ff697c39 100644 --- a/gooddata-sdk/gooddata_sdk/catalog/identifier.py +++ b/gooddata-sdk/gooddata_sdk/catalog/identifier.py @@ -7,6 +7,9 @@ from attrs import define from gooddata_api_client.model.assignee_identifier import AssigneeIdentifier from gooddata_api_client.model.dataset_workspace_data_filter_identifier import DatasetWorkspaceDataFilterIdentifier +from gooddata_api_client.model.declarative_analytical_dashboard_identifier import ( + DeclarativeAnalyticalDashboardIdentifier, +) from gooddata_api_client.model.declarative_export_definition_identifier import DeclarativeExportDefinitionIdentifier from gooddata_api_client.model.declarative_notification_channel_identifier import ( DeclarativeNotificationChannelIdentifier, @@ -114,3 +117,13 @@ class CatalogNotificationChannelIdentifier(Base): @staticmethod def client_class() -> builtins.type[DeclarativeNotificationChannelIdentifier]: return DeclarativeNotificationChannelIdentifier + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogDeclarativeAnalyticalDashboardIdentifier(Base): + id: str + type: str = attr.field(validator=value_in_allowed) + + @staticmethod + def client_class() -> builtins.type[DeclarativeAnalyticalDashboardIdentifier]: + return DeclarativeAnalyticalDashboardIdentifier diff --git a/gooddata-sdk/gooddata_sdk/catalog/workspace/declarative_model/workspace/workspace.py b/gooddata-sdk/gooddata_sdk/catalog/workspace/declarative_model/workspace/workspace.py index 5641f80ec..a70d0d5de 100644 --- a/gooddata-sdk/gooddata_sdk/catalog/workspace/declarative_model/workspace/workspace.py +++ b/gooddata-sdk/gooddata_sdk/catalog/workspace/declarative_model/workspace/workspace.py @@ -6,6 +6,7 @@ from typing import Any, Optional import attr +from gooddata_api_client.model.declarative_filter_view import DeclarativeFilterView from gooddata_api_client.model.declarative_user_data_filter import DeclarativeUserDataFilter from gooddata_api_client.model.declarative_user_data_filters import DeclarativeUserDataFilters from gooddata_api_client.model.declarative_workspace import DeclarativeWorkspace @@ -17,6 +18,7 @@ from gooddata_sdk.catalog.base import Base from gooddata_sdk.catalog.identifier import ( + CatalogDeclarativeAnalyticalDashboardIdentifier, CatalogDeclarativeUserGroupIdentifier, CatalogUserIdentifier, CatalogWorkspaceIdentifier, @@ -36,6 +38,7 @@ LAYOUT_WORKSPACES_DIR = "workspaces" LAYOUT_WORKSPACES_DATA_FILTERS_DIR = "workspaces_data_filters" LAYOUT_USER_DATA_FILTERS_DIR = "user_data_filters" +LAYOUT_FILTER_VIEWS_DIR = "filter_views" def get_workspace_folder(workspace_id: str, layout_organization_folder: Path) -> Path: @@ -85,6 +88,7 @@ class CatalogDeclarativeWorkspace(Base): user_data_filters: list[CatalogDeclarativeUserDataFilter] = attr.field(factory=list) custom_application_settings: list[CatalogDeclarativeCustomApplicationSetting] = attr.field(factory=list) automations: list[CatalogDeclarativeAutomation] = attr.field(factory=list) + filter_views: list[CatalogDeclarativeFilterView] = attr.field(factory=list) @staticmethod def client_class() -> type[DeclarativeWorkspace]: @@ -211,12 +215,13 @@ def load_from_disk(cls, workspaces_data_filter_file: Path) -> CatalogDeclarative @classmethod def from_dict(cls, data: dict[str, Any], camel_case: bool = True) -> CatalogDeclarativeWorkspaceDataFilter: """ - :param data: Data loaded for example from the file. - :param camel_case: True if the variable names in the input - data are serialized names as specified in the OpenAPI document. - False if the variables names in the input data are python - variable names in PEP-8 snake case. - :return: CatalogDeclarativeWorkspaceDataFilter object. + Args: + data (dict[str, Any]): Data loaded, for example, from a file. + camel_case (bool): True if the variable names in the input data are serialized names as specified in the OpenAPI document. + False if the variable names in the input data are Python variable names in PEP-8 snake case. + + Returns: + CatalogDeclarativeWorkspaceDataFilter: CatalogDeclarativeWorkspaceDataFilter object. """ declarative_workspace_data_filter = DeclarativeWorkspaceDataFilter.from_dict(data, camel_case) return cls.from_api(declarative_workspace_data_filter) @@ -272,16 +277,55 @@ def load_from_disk(cls, user_data_filter_file: Path) -> CatalogDeclarativeUserDa @classmethod def from_dict(cls, data: dict[str, Any], camel_case: bool = True) -> CatalogDeclarativeUserDataFilter: + """ + Args: + data (dict[str, Any]): Data loaded, for example, from a file. + camel_case (bool): True if the variable names in the input data are serialized names as specified in the OpenAPI document. + False if the variable names in the input data are Python variable names in PEP-8 snake case. + + Returns: + CatalogDeclarativeUserDataFilter: CatalogDeclarativeUserDataFilter object. + """ + declarative_user_data_filter = DeclarativeUserDataFilter.from_dict(data, camel_case) + return cls.from_api(declarative_user_data_filter) + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogDeclarativeFilterView(Base): + id: str + title: str + analytical_dashboard: Optional[CatalogDeclarativeAnalyticalDashboardIdentifier] = None + content: Optional[dict[str, Any]] = None + description: Optional[str] = None + is_default: Optional[bool] = None + tags: Optional[list[str]] = None + user: Optional[CatalogUserIdentifier] = None + + @staticmethod + def client_class() -> type[DeclarativeFilterView]: + return DeclarativeFilterView + + def store_to_disk(self, filter_views_folder: Path) -> None: + filter_view_file = filter_views_folder / f"{self.id}.yaml" + write_layout_to_file(filter_view_file, self.to_api().to_dict(camel_case=True)) + + @classmethod + def load_from_disk(cls, filter_view_file: Path) -> CatalogDeclarativeFilterView: + filter_view = read_layout_from_file(filter_view_file) + return CatalogDeclarativeFilterView.from_dict(filter_view, camel_case=True) + + @classmethod + def from_dict(cls, data: dict[str, Any], camel_case: bool = True) -> CatalogDeclarativeFilterView: """ :param data: Data loaded for example from the file. :param camel_case: True if the variable names in the input data are serialized names as specified in the OpenAPI document. False if the variables names in the input data are python variable names in PEP-8 snake case. - :return: CatalogDeclarativeUserDataFilter object. + :return: CatalogDeclarativeFilterView object. """ - declarative_user_data_filter = DeclarativeUserDataFilter.from_dict(data, camel_case) - return cls.from_api(declarative_user_data_filter) + declarative_filter_view = DeclarativeFilterView.from_dict(data, camel_case) + return cls.from_api(declarative_filter_view) @attr.s(auto_attribs=True, kw_only=True) @@ -305,6 +349,10 @@ def workspace_data_filters_folder(layout_organization_folder: Path) -> Path: def user_data_filters_folder(layout_organization_folder: Path) -> Path: return layout_organization_folder / LAYOUT_USER_DATA_FILTERS_DIR + @staticmethod + def filter_views_folder(layout_organization_folder: Path) -> Path: + return layout_organization_folder / LAYOUT_FILTER_VIEWS_DIR + def store_to_disk(self, layout_organization_folder: Path) -> None: workspaces_folder = self.workspaces_folder(layout_organization_folder) workspaces_data_filters_folder = self.workspace_data_filters_folder(layout_organization_folder) diff --git a/gooddata-sdk/gooddata_sdk/catalog/workspace/entity_model/filter_view.py b/gooddata-sdk/gooddata_sdk/catalog/workspace/entity_model/filter_view.py new file mode 100644 index 000000000..87364998e --- /dev/null +++ b/gooddata-sdk/gooddata_sdk/catalog/workspace/entity_model/filter_view.py @@ -0,0 +1,146 @@ +# (C) 2024 GoodData Corporation +from __future__ import annotations + +from typing import Any, Optional, Union + +import attr +from gooddata_api_client.model.json_api_filter_view_in import JsonApiFilterViewIn +from gooddata_api_client.model.json_api_filter_view_in_attributes import JsonApiFilterViewInAttributes +from gooddata_api_client.model.json_api_filter_view_in_document import JsonApiFilterViewInDocument +from gooddata_api_client.model.json_api_filter_view_in_relationships import JsonApiFilterViewInRelationships + +from gooddata_sdk.catalog.base import Base +from gooddata_sdk.catalog.identifier import CatalogDeclarativeAnalyticalDashboardIdentifier, CatalogUserIdentifier + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogFilterViewDocument(Base): + data: CatalogFilterView + + @staticmethod + def client_class() -> type[JsonApiFilterViewInDocument]: + return JsonApiFilterViewInDocument + + def to_api(self) -> JsonApiFilterViewInDocument: + return JsonApiFilterViewInDocument(data=self.data.to_api()) + + +def _data_entity(value: Any) -> dict[str, Any]: + return {"data": value} + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogFilterView(Base): + id: Optional[str] = None + attributes: CatalogFilterViewAttributes + relationships: Optional[CatalogFilterViewRelationships] = None + + @staticmethod + def client_class() -> type[JsonApiFilterViewIn]: + return JsonApiFilterViewIn + + @classmethod + def init( + cls, + filter_view_id: str, + content: dict[str, Any], + title: str, + are_relations_valid: Optional[bool] = None, + description: Optional[str] = None, + is_default: Optional[bool] = None, + tags: Optional[list[str]] = None, + user_id: Optional[str] = None, + analytical_dashboard_id: Optional[str] = None, + ) -> CatalogFilterView: + attributes = CatalogFilterViewAttributes( + content=content, + title=title, + are_relations_valid=are_relations_valid, + description=description, + is_default=is_default, + tags=tags, + ) + relationships = CatalogFilterViewRelationships.create_user_analytical_dashboard_relationship( + user_id=user_id, analytical_dashboard_id=analytical_dashboard_id + ) + return cls(id=filter_view_id, attributes=attributes, relationships=relationships) + + def to_api(self) -> JsonApiFilterViewIn: + attributes = self.attributes.to_api() + relationships = self.relationships.to_api() if self.relationships is not None else None + return JsonApiFilterViewIn(id=self.id, attributes=attributes, relationships=relationships) + + @property + def user_id(self) -> Union[str, None]: + if self.relationships and self.relationships.user: + return self.relationships.user["data"].id + return None + + @property + def analytical_dashboard_id(self) -> Union[str, None]: + if self.relationships and self.relationships.analytical_dashboard: + return self.relationships.analytical_dashboard["data"].id + return None + + def assign_user(self, user_id: str) -> None: + if self.relationships is None: + self.relationships = CatalogFilterViewRelationships.create_user_analytical_dashboard_relationship( + user_id=user_id + ) + else: + self.relationships.user = _data_entity(CatalogUserIdentifier(id=user_id, type="user")) + + def assign_analytical_dashboard(self, analytical_dashboard_id: str) -> None: + if self.relationships is None: + self.relationships = CatalogFilterViewRelationships.create_user_analytical_dashboard_relationship( + analytical_dashboard_id=analytical_dashboard_id + ) + else: + self.relationships.analytical_dashboard = _data_entity( + CatalogDeclarativeAnalyticalDashboardIdentifier(id=analytical_dashboard_id, type="analyticalDashboard") + ) + + def clean_relationships(self) -> None: + if self.relationships is not None: + self.relationships.user = None + self.relationships.analytical_dashboard = None + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogFilterViewAttributes(Base): + content: dict[str, Any] + title: str + are_relations_valid: Optional[bool] = None + description: Optional[str] = None + is_default: Optional[bool] = None + tags: Optional[list[str]] = None + + @staticmethod + def client_class() -> type[JsonApiFilterViewInAttributes]: + return JsonApiFilterViewInAttributes + + +@attr.s(auto_attribs=True, kw_only=True) +class CatalogFilterViewRelationships(Base): + user: Optional[dict[str, CatalogUserIdentifier]] = None + analytical_dashboard: Optional[dict[str, CatalogDeclarativeAnalyticalDashboardIdentifier]] = None + + @staticmethod + def client_class() -> type[JsonApiFilterViewInRelationships]: + return JsonApiFilterViewInRelationships + + @classmethod + def create_user_analytical_dashboard_relationship( + cls, user_id: Optional[str] = None, analytical_dashboard_id: Optional[str] = None + ) -> CatalogFilterViewRelationships | None: + if user_id is None and analytical_dashboard_id is None: + return None + assignee_user = _data_entity(CatalogUserIdentifier(id=user_id, type="user")) if user_id else None + assignee_analytical_dashboard = ( + _data_entity( + CatalogDeclarativeAnalyticalDashboardIdentifier(id=analytical_dashboard_id, type="analyticalDashboard") + ) + if analytical_dashboard_id + else None + ) + return cls(user=assignee_user, analytical_dashboard=assignee_analytical_dashboard) diff --git a/gooddata-sdk/gooddata_sdk/catalog/workspace/entity_model/user_data_filter.py b/gooddata-sdk/gooddata_sdk/catalog/workspace/entity_model/user_data_filter.py index 6284b92b6..428d55754 100644 --- a/gooddata-sdk/gooddata_sdk/catalog/workspace/entity_model/user_data_filter.py +++ b/gooddata-sdk/gooddata_sdk/catalog/workspace/entity_model/user_data_filter.py @@ -91,13 +91,13 @@ def to_api(self, post: bool = False) -> Union[JsonApiUserDataFilterPostOptionalI return JsonApiUserDataFilterIn(id=self.id, attributes=attributes, relationships=relationships) @property - def user_id(self) -> str | None: + def user_id(self) -> Union[str, None]: if self.relationships and self.relationships.user: return self.relationships.user["data"].id return None @property - def user_group_id(self) -> str | None: + def user_group_id(self) -> Union[str, None]: if self.relationships and self.relationships.user_group: return self.relationships.user_group["data"].id return None diff --git a/gooddata-sdk/gooddata_sdk/catalog/workspace/service.py b/gooddata-sdk/gooddata_sdk/catalog/workspace/service.py index dd6fb8172..69a28f39f 100644 --- a/gooddata-sdk/gooddata_sdk/catalog/workspace/service.py +++ b/gooddata-sdk/gooddata_sdk/catalog/workspace/service.py @@ -21,6 +21,7 @@ from gooddata_sdk.catalog.catalog_service_base import CatalogServiceBase from gooddata_sdk.catalog.permission.service import CatalogPermissionService from gooddata_sdk.catalog.workspace.declarative_model.workspace.workspace import ( + CatalogDeclarativeFilterView, CatalogDeclarativeUserDataFilters, CatalogDeclarativeWorkspaceDataFilters, CatalogDeclarativeWorkspaceModel, @@ -28,6 +29,10 @@ get_workspace_folder, ) from gooddata_sdk.catalog.workspace.entity_model.content_objects.workspace_setting import CatalogWorkspaceSetting +from gooddata_sdk.catalog.workspace.entity_model.filter_view import ( + CatalogFilterView, + CatalogFilterViewDocument, +) from gooddata_sdk.catalog.workspace.entity_model.user_data_filter import ( CatalogUserDataFilter, CatalogUserDataFilterDocument, @@ -1263,3 +1268,169 @@ def put_declarative_automations(self, workspace_id: str, automations: list[Catal """ api_automations = [automation.to_api() for automation in automations] self._layout_api.set_automations(workspace_id, api_automations) + + def list_filters_views(self, workspace_id: str) -> list[CatalogFilterView]: + """list all filter views. + + Args: + workspace_id (str): + String containing id of the workspace. + + Returns: + list[CatalogFilterView]: + List of filter view entities. + """ + get_filter_views = functools.partial( + self._entities_api.get_all_entities_filter_views, + workspace_id, + _check_return_type=False, + include=["ALL"], + ) + filter_views = load_all_entities_dict(get_filter_views, camel_case=False) + return [CatalogFilterView.from_dict(v, camel_case=False) for v in filter_views["data"]] + + def create_or_update_filter_view(self, workspace_id: str, filter_view: CatalogFilterView) -> None: + """Create a new filter view or overwrite an existing one. + + Args: + workspace_id (str): + String containing id of the workspace. + filter_view (CatalogFilterView): + FilterView entity object. + + Returns: + None + """ + filter_view_document = CatalogFilterViewDocument(data=filter_view) + if filter_view.id is None: + self._entities_api.create_entity_filter_views( + workspace_id=workspace_id, + json_api_filter_view_in_document=filter_view_document.to_api(), + ) + else: + try: + self.get_filter_view(workspace_id=workspace_id, filter_view_id=filter_view.id) + self._entities_api.update_entity_filter_views( + workspace_id=workspace_id, + object_id=filter_view.id, + json_api_filter_view_in_document=filter_view_document.to_api(), + ) + except NotFoundException: + self._entities_api.create_entity_filter_views( + workspace_id=workspace_id, + json_api_filter_view_in_document=filter_view_document.to_api(), + ) + + def get_filter_view(self, workspace_id: str, filter_view_id: str) -> CatalogFilterView: + """Get filter view by its id. + + Args: + workspace_id (str): + String containing id of the workspace. + filter_view_id (str): + String containing id of the filter view. + + Returns: + CatalogFilterView: + FilterView entity object. + """ + filter_view_dict = self._entities_api.get_entity_filter_views( + workspace_id=workspace_id, + object_id=filter_view_id, + include=["ALL"], + _check_return_type=False, + ).data + + return CatalogFilterView.from_dict(filter_view_dict, camel_case=True) + + def delete_filter_view(self, workspace_id: str, filter_view_id: str) -> None: + """Delete filter view. + + Args: + workspace_id (str): + String containing id of the workspace. + filter_view_id (str): + String containing id of the deleting filter view. + + Returns: + None + """ + self._entities_api.delete_entity_filter_views(workspace_id=workspace_id, object_id=filter_view_id) + + def get_declarative_filter_views(self, workspace_id: str) -> list[CatalogDeclarativeFilterView]: + """Retrieve a list of declarative filter views. + + Args: + workspace_id (str): + Workspace identification string e.g. "demo" + + Returns: + list[CatalogDeclarativeFilterView]: + List of declarative filter views. + """ + return [ + CatalogDeclarativeFilterView.from_dict(filter_view.to_dict(), camel_case=False) + for filter_view in self._layout_api.get_filter_views(workspace_id) + ] + + def put_declarative_filter_views(self, workspace_id: str, filter_views: list[CatalogDeclarativeFilterView]) -> None: + """Set filter views for the workspace. + + Args: + workspace_id (str): + Workspace identification string e.g. "demo" + filter_views (list[CatalogDeclarativeFilterView]): + List of declarative filter views. + + Returns: + None + """ + api_filter_views = [filter_view.to_api() for filter_view in filter_views] + self._layout_api.set_filter_views(workspace_id=workspace_id, declarative_filter_view=api_filter_views) + + def store_declarative_filter_views(self, workspace_id: str, layout_root_path: Path = Path.cwd()) -> None: + """Store filter views layout in a directory hierarchy. + + Args: + workspace_id (str): + id of the related workspace + layout_root_path (Path, optional): + Path to the root of the layout directory. Defaults to Path.cwd(). + + Returns: + None + """ + self.get_declarative_filter_views(workspace_id).store_to_disk(self.layout_organization_folder(layout_root_path)) + + def load_declarative_filter_views(self, layout_root_path: Path = Path.cwd()) -> list[CatalogDeclarativeFilterView]: + """Loads filter views layout, which was stored using `store_declarative_filter_views`. + + Args: + layout_root_path (Path, optional): + Path to the root of the layout directory. Defaults to Path.cwd(). + + Returns: + list[CatalogDeclarativeFilterView]: + List of declarative filter views. + """ + return CatalogDeclarativeFilterView.load_from_disk(self.layout_organization_folder(layout_root_path)) + + def load_and_put_declarative_filter_views(self, workspace_id: str, layout_root_path: Path = Path.cwd()) -> None: + """Loads and sets the layouts stored using `store_declarative_filter_views`. + + This method combines `load_declarative_filter_views` and `put_declarative_filter_views` + methods to load and set layouts stored using `store_declarative_filter_views`. + + Args: + workspace_id (str): + String containing id of the workspace + layout_root_path (Path, optional): + Path to the root of the layout directory. Defaults to Path.cwd(). + + Returns: + None + """ + declarative_filter_views = CatalogDeclarativeFilterView.load_from_disk( + self.layout_organization_folder(layout_root_path) + ) + self.put_declarative_filter_views(workspace_id, declarative_filter_views) diff --git a/gooddata-sdk/tests/catalog/expected/declarative_workspaces.json b/gooddata-sdk/tests/catalog/expected/declarative_workspaces.json index eb041cad0..281b779a4 100644 --- a/gooddata-sdk/tests/catalog/expected/declarative_workspaces.json +++ b/gooddata-sdk/tests/catalog/expected/declarative_workspaces.json @@ -1,7 +1,9 @@ { "workspaces": [ { + "automations": [], "customApplicationSettings": [], + "filterViews": [], "hierarchyPermissions": [ { "assignee": { @@ -2791,7 +2793,9 @@ "automations": [] }, { + "automations": [], "customApplicationSettings": [], + "filterViews": [], "hierarchyPermissions": [], "id": "demo_west", "model": { @@ -2848,7 +2852,9 @@ "automations": [] }, { + "automations": [], "customApplicationSettings": [], + "filterViews": [], "hierarchyPermissions": [], "id": "demo_west_california", "model": { diff --git a/gooddata-sdk/tests/catalog/expected/declarative_workspaces_snake_case.json b/gooddata-sdk/tests/catalog/expected/declarative_workspaces_snake_case.json index f9b85a2ea..b355c9ac9 100644 --- a/gooddata-sdk/tests/catalog/expected/declarative_workspaces_snake_case.json +++ b/gooddata-sdk/tests/catalog/expected/declarative_workspaces_snake_case.json @@ -2777,7 +2777,8 @@ "settings": [], "user_data_filters": [], "custom_application_settings": [], - "automations": [] + "automations": [], + "filter_views": [] }, { "id": "demo_west", @@ -2832,7 +2833,8 @@ "settings": [], "user_data_filters": [], "custom_application_settings": [], - "automations": [] + "automations": [], + "filter_views": [] }, { "id": "demo_west_california", @@ -2861,7 +2863,8 @@ "settings": [], "user_data_filters": [], "custom_application_settings": [], - "automations": [] + "automations": [], + "filter_views": [] } ], "workspace_data_filters": [ diff --git a/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_load_and_modify_ds_and_put_declarative_ldm.yaml b/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_load_and_modify_ds_and_put_declarative_ldm.yaml index 5bd698be8..5e089ae95 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_load_and_modify_ds_and_put_declarative_ldm.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_load_and_modify_ds_and_put_declarative_ldm.yaml @@ -3637,6 +3637,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -3674,6 +3675,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -3698,6 +3700,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_load_and_put_declarative_analytics_model.yaml b/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_load_and_put_declarative_analytics_model.yaml index f460dc77e..84f65c8b6 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_load_and_put_declarative_analytics_model.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_load_and_put_declarative_analytics_model.yaml @@ -6988,6 +6988,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -7025,6 +7026,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -7049,6 +7051,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_load_and_put_declarative_ldm.yaml b/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_load_and_put_declarative_ldm.yaml index b2ebd1588..e0a2177b5 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_load_and_put_declarative_ldm.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_load_and_put_declarative_ldm.yaml @@ -3209,6 +3209,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -3246,6 +3247,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -3270,6 +3272,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_put_declarative_analytics_model.yaml b/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_put_declarative_analytics_model.yaml index 5ee103c5f..fa0a39c80 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_put_declarative_analytics_model.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_put_declarative_analytics_model.yaml @@ -2911,6 +2911,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -2948,6 +2949,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -2972,6 +2974,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_put_declarative_ldm.yaml b/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_put_declarative_ldm.yaml index c5fdec67f..fef57bf97 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_put_declarative_ldm.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspace_content/demo_put_declarative_ldm.yaml @@ -3071,6 +3071,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -3108,6 +3109,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -3132,6 +3134,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspace_content/explicit_workspace_data_filter.yaml b/gooddata-sdk/tests/catalog/fixtures/workspace_content/explicit_workspace_data_filter.yaml index f161f302b..966f72563 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspace_content/explicit_workspace_data_filter.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspace_content/explicit_workspace_data_filter.yaml @@ -5490,6 +5490,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -5527,6 +5528,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -5551,6 +5553,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspace_content/export_definition_analytics_layout.yaml b/gooddata-sdk/tests/catalog/fixtures/workspace_content/export_definition_analytics_layout.yaml index 2605ca101..cd97af1b8 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspace_content/export_definition_analytics_layout.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspace_content/export_definition_analytics_layout.yaml @@ -5893,6 +5893,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -5930,6 +5931,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -5954,6 +5956,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_clone_workspace.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_clone_workspace.yaml index 0120c8cba..7abc1a9b7 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_clone_workspace.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_clone_workspace.yaml @@ -17774,6 +17774,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -17811,6 +17812,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -17835,6 +17837,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_create_workspace.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_create_workspace.yaml index 7ad5ceb86..49dbbfc48 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_create_workspace.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_create_workspace.yaml @@ -2205,6 +2205,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -2242,6 +2243,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -2266,6 +2268,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_declarative_workspaces.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_declarative_workspaces.yaml index d4a412d88..dba9c37cd 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_declarative_workspaces.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_declarative_workspaces.yaml @@ -107,6 +107,7 @@ interactions: workspaces: - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: - assignee: id: demo2 @@ -1786,6 +1787,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west model: @@ -1823,6 +1825,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west_california model: @@ -1950,6 +1953,7 @@ interactions: workspaces: - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: - assignee: id: demo2 @@ -3629,6 +3633,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west model: @@ -3666,6 +3671,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west_california model: diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_delete_workspace.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_delete_workspace.yaml index acf9ba7ca..24756ab80 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_delete_workspace.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_delete_workspace.yaml @@ -2110,6 +2110,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -2147,6 +2148,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -2171,6 +2173,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_get_declarative_workspaces.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_get_declarative_workspaces.yaml index a7a911551..8be161f64 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_get_declarative_workspaces.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_get_declarative_workspaces.yaml @@ -107,6 +107,7 @@ interactions: workspaces: - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: - assignee: id: demo2 @@ -1786,6 +1787,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west model: @@ -1823,6 +1825,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west_california model: diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_get_declarative_workspaces_snake_case.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_get_declarative_workspaces_snake_case.yaml index a7a911551..8be161f64 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_get_declarative_workspaces_snake_case.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_get_declarative_workspaces_snake_case.yaml @@ -107,6 +107,7 @@ interactions: workspaces: - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: - assignee: id: demo2 @@ -1786,6 +1787,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west model: @@ -1823,6 +1825,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west_california model: diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_user_data_filters.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_user_data_filters.yaml index 46a86da2a..bd09b148e 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_user_data_filters.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_user_data_filters.yaml @@ -2220,6 +2220,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -2257,6 +2258,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -2281,6 +2283,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_workspace.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_workspace.yaml index 2fa4a0db6..10ff4ef76 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_workspace.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_workspace.yaml @@ -7172,6 +7172,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -7209,6 +7210,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -7233,6 +7235,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_workspace_data_filters.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_workspace_data_filters.yaml index 72285f1bb..7a8b562bc 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_workspace_data_filters.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_workspace_data_filters.yaml @@ -2304,6 +2304,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -2341,6 +2342,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -2365,6 +2367,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_workspaces.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_workspaces.yaml index ad9c490f7..32941e334 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_workspaces.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_load_and_put_declarative_workspaces.yaml @@ -1996,6 +1996,7 @@ interactions: userDataFilters: [] customApplicationSettings: [] automations: [] + filterViews: [] - id: demo_west name: Demo West model: @@ -2033,6 +2034,7 @@ interactions: userDataFilters: [] customApplicationSettings: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California model: @@ -2057,6 +2059,7 @@ interactions: userDataFilters: [] customApplicationSettings: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate @@ -2225,6 +2228,7 @@ interactions: workspaces: - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: - assignee: id: demo2 @@ -3904,6 +3908,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west model: @@ -3941,6 +3946,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west_california model: @@ -5675,6 +5681,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -5712,6 +5719,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -5736,6 +5744,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_user_data_filters.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_user_data_filters.yaml index 85767f12b..03f1064d4 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_user_data_filters.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_user_data_filters.yaml @@ -1868,6 +1868,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -1905,6 +1906,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -1929,6 +1931,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_workspace.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_workspace.yaml index 28015801e..5687b7b4e 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_workspace.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_workspace.yaml @@ -7027,6 +7027,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -7064,6 +7065,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -7088,6 +7090,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_workspace_data_filters.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_workspace_data_filters.yaml index 5a1eb4975..8147e7c89 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_workspace_data_filters.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_workspace_data_filters.yaml @@ -2156,6 +2156,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -2193,6 +2194,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -2217,6 +2219,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_workspaces.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_workspaces.yaml index 8cc09a3cd..53045bea6 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_workspaces.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_put_declarative_workspaces.yaml @@ -107,6 +107,7 @@ interactions: workspaces: - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: - assignee: id: demo2 @@ -1786,6 +1787,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west model: @@ -1823,6 +1825,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west_california model: @@ -3701,6 +3704,7 @@ interactions: userDataFilters: [] customApplicationSettings: [] automations: [] + filterViews: [] - id: demo_west name: Demo West model: @@ -3738,6 +3742,7 @@ interactions: userDataFilters: [] customApplicationSettings: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California model: @@ -3762,6 +3767,7 @@ interactions: userDataFilters: [] customApplicationSettings: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate @@ -3930,6 +3936,7 @@ interactions: workspaces: - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: - assignee: id: demo2 @@ -5609,6 +5616,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west model: @@ -5646,6 +5654,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west_california model: @@ -7380,6 +7389,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -7417,6 +7427,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -7441,6 +7452,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_store_declarative_workspaces.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_store_declarative_workspaces.yaml index c7b5fbf03..445796436 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_store_declarative_workspaces.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_store_declarative_workspaces.yaml @@ -107,6 +107,7 @@ interactions: workspaces: - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: - assignee: id: demo2 @@ -1962,6 +1963,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west model: @@ -1999,6 +2001,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west_california model: @@ -2126,6 +2129,7 @@ interactions: workspaces: - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: - assignee: id: demo2 @@ -3981,6 +3985,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west model: @@ -4018,6 +4023,7 @@ interactions: userDataFilters: [] - automations: [] customApplicationSettings: [] + filterViews: [] hierarchyPermissions: [] id: demo_west_california model: diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_translate_workspace.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_translate_workspace.yaml index 6c5052acc..bc771c889 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_translate_workspace.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_translate_workspace.yaml @@ -8536,6 +8536,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -8573,6 +8574,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -8597,6 +8599,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_update_workspace_valid.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_update_workspace_valid.yaml index 013a3109b..07a9aaf81 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_update_workspace_valid.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/demo_update_workspace_valid.yaml @@ -2294,6 +2294,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -2331,6 +2332,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -2355,6 +2357,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/user_data_filters_for_user_group.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/user_data_filters_for_user_group.yaml index 9c5faa109..d112e5a33 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/user_data_filters_for_user_group.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/user_data_filters_for_user_group.yaml @@ -2330,6 +2330,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -2367,6 +2368,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -2391,6 +2393,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/fixtures/workspaces/user_data_filters_life_cycle.yaml b/gooddata-sdk/tests/catalog/fixtures/workspaces/user_data_filters_life_cycle.yaml index 3c73cb653..4853b2dd5 100644 --- a/gooddata-sdk/tests/catalog/fixtures/workspaces/user_data_filters_life_cycle.yaml +++ b/gooddata-sdk/tests/catalog/fixtures/workspaces/user_data_filters_life_cycle.yaml @@ -2336,6 +2336,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west name: Demo West customApplicationSettings: [] @@ -2373,6 +2374,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] - id: demo_west_california name: Demo West California customApplicationSettings: [] @@ -2397,6 +2399,7 @@ interactions: settings: [] userDataFilters: [] automations: [] + filterViews: [] headers: Accept-Encoding: - br, gzip, deflate diff --git a/gooddata-sdk/tests/catalog/test_catalog_workspace.py b/gooddata-sdk/tests/catalog/test_catalog_workspace.py index 7651c7619..da51851de 100644 --- a/gooddata-sdk/tests/catalog/test_catalog_workspace.py +++ b/gooddata-sdk/tests/catalog/test_catalog_workspace.py @@ -11,6 +11,7 @@ CatalogAutomationSchedule, CatalogDataSourcePostgres, CatalogDeclarativeAutomation, + CatalogDeclarativeFilterView, CatalogDeclarativeUserDataFilter, CatalogDeclarativeUserDataFilters, CatalogDeclarativeWorkspaceDataFilters, @@ -23,7 +24,11 @@ GoodDataSdk, PostgresAttributes, ) -from gooddata_sdk.catalog.identifier import CatalogNotificationChannelIdentifier, CatalogUserIdentifier +from gooddata_sdk.catalog.identifier import ( + CatalogDeclarativeAnalyticalDashboardIdentifier, + CatalogNotificationChannelIdentifier, + CatalogUserIdentifier, +) from gooddata_sdk.catalog.organization.layout.notification_channel import ( CatalogDeclarativeNotificationChannel, CatalogWebhook, @@ -959,3 +964,70 @@ def test_layout_automations(test_config): automations = sdk.catalog_workspace.get_declarative_automations(workspace_id) assert len(automations) == 0 sdk.catalog_organization.put_declarative_notification_channels([]) + + +@gd_vcr.use_cassette(str(_fixtures_dir / "layout_filter_views.yaml")) +def test_layout_filter_views(test_config): + sdk = GoodDataSdk.create(host_=test_config["host"], token_=test_config["token"]) + workspace_id = test_config["workspace"] + + filter_views = sdk.catalog_workspace.get_declarative_filter_views(workspace_id) + assert len(filter_views) == 0 + + content = json.loads( + """ + { + "filters": [ + { + "dateFilter": { + "from": "0", + "to": "0", + "granularity": "GDC.time.month", + "type": "relative" + } + }, + { + "attributeFilter": { + "displayForm": { + "identifier": { + "id": "demo:campaign_name", + "type": "label" + } + }, + "negativeSelection": true, + "attributeElements": { + "uris": [] + }, + "localIdentifier": "14b0807447ef4bc28f43e4fc5c337d1d", + "filterElementsBy": [], + "selectionMode": "multi" + } + } + ], + "version": "2" + } + """ + ) + + try: + filter_views_expected = [ + CatalogDeclarativeFilterView( + id="filter_view", + title="Filter View", + is_default=True, + description="Filter View", + tags=["tag1", "tag2"], + user=CatalogUserIdentifier(id="demo", type="user"), + analytical_dashboard=CatalogDeclarativeAnalyticalDashboardIdentifier( + id="campaign", type="analyticalDashboard" + ), + content=content, + ) + ] + sdk.catalog_workspace.put_declarative_filter_views(workspace_id, filter_views_expected) + filter_views_o = sdk.catalog_workspace.get_declarative_filter_views(workspace_id) + assert filter_views_expected == filter_views_o + finally: + sdk.catalog_workspace.put_declarative_filter_views(workspace_id, []) + filter_views = sdk.catalog_workspace.get_declarative_filter_views(workspace_id) + assert len(filter_views) == 0