diff --git a/packages/gooddata-sdk/src/gooddata_sdk/__init__.py b/packages/gooddata-sdk/src/gooddata_sdk/__init__.py index d268f9ebf..11b4753ee 100644 --- a/packages/gooddata-sdk/src/gooddata_sdk/__init__.py +++ b/packages/gooddata-sdk/src/gooddata_sdk/__init__.py @@ -191,6 +191,7 @@ CatalogDeclarativeExportDefinitionRequestPayload, ) from gooddata_sdk.catalog.workspace.declarative_model.workspace.automation import ( + CatalogAutomationAlert, CatalogAutomationSchedule, CatalogDeclarativeAutomation, ) diff --git a/packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/declarative_model/workspace/automation.py b/packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/declarative_model/workspace/automation.py index 079fd90a8..3e45b3eef 100644 --- a/packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/declarative_model/workspace/automation.py +++ b/packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/declarative_model/workspace/automation.py @@ -1,8 +1,11 @@ # (C) 2024 GoodData Corporation +from __future__ import annotations + import builtins -from typing import Any +from typing import Any, Literal from attrs import define, field +from gooddata_api_client.model.automation_alert import AutomationAlert from gooddata_api_client.model.automation_schedule import AutomationSchedule from gooddata_api_client.model.automation_tabular_export import AutomationTabularExport from gooddata_api_client.model.automation_visual_export import AutomationVisualExport @@ -20,6 +23,9 @@ ) from gooddata_sdk.catalog.workspace.declarative_model.workspace.analytics_model.base import CatalogAnalyticsBaseMeta +AlertTrigger = Literal["ALWAYS", "ONCE", "ONCE_PER_INTERVAL"] +IntervalGranularity = Literal["DAY", "WEEK", "MONTH", "QUARTER", "YEAR"] + @define(kw_only=True) class CatalogAutomationSchedule(Base): @@ -51,6 +57,18 @@ def client_class() -> builtins.type[AutomationVisualExport]: return AutomationVisualExport +@define(kw_only=True) +class CatalogAutomationAlert(Base): + condition: dict[str, Any] + execution: dict[str, Any] + trigger: AlertTrigger | None = None + interval: IntervalGranularity | None = None + + @staticmethod + def client_class() -> builtins.type[AutomationAlert]: + return AutomationAlert + + @define(kw_only=True) class CatalogDeclarativeAutomation(CatalogAnalyticsBaseMeta): description: str | None = None @@ -65,6 +83,7 @@ class CatalogDeclarativeAutomation(CatalogAnalyticsBaseMeta): schedule: CatalogAutomationSchedule | None = None tabular_exports: list[CatalogAutomationTabularExport] | None = None visual_exports: list[CatalogAutomationVisualExport] | None = None + alert: CatalogAutomationAlert | None = None @staticmethod def client_class() -> builtins.type[DeclarativeAutomation]: