Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/gooddata-sdk/src/gooddata_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
CatalogDeclarativeExportDefinitionRequestPayload,
)
from gooddata_sdk.catalog.workspace.declarative_model.workspace.automation import (
CatalogAutomationAlert,
CatalogAutomationSchedule,
CatalogDeclarativeAutomation,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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):
Expand Down Expand Up @@ -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
Expand All @@ -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]:
Expand Down
Loading