Skip to content

Commit 31c1649

Browse files
committed
fix: adapt gooddata-sdk to regenerated api-client
risk: low
1 parent db7dcd8 commit 31c1649

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

packages/gooddata-sdk/src/gooddata_sdk/catalog/organization/layout/notification_channel.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,23 @@
33

44
from attrs import define, field
55
from gooddata_api_client.model.declarative_notification_channel import DeclarativeNotificationChannel
6+
from gooddata_api_client.model.notification_channel_destination import NotificationChannelDestination
67
from gooddata_api_client.model.webhook import Webhook
78

89
from gooddata_sdk.catalog.base import Base
910

11+
# The generator collapses the `type` enums of NotificationChannelDestination's oneOf children
12+
# into the last child's single value (IN_PLATFORM), so valid destinations of the other types
13+
# fail client-side validation on both serialization and response parsing. Restore the full set.
14+
NotificationChannelDestination.allowed_values[("type",)].update(
15+
{
16+
"WEBHOOK": "WEBHOOK",
17+
"SMTP": "SMTP",
18+
"DEFAULT_SMTP": "DEFAULT_SMTP",
19+
"IN_PLATFORM": "IN_PLATFORM",
20+
}
21+
)
22+
1023
# TODO: there is an issue with generated client which causes these two classes to fail
1124
# type in gooddata_api_client/model/declarative_notification_channel_destination.py contains only WEBHOOK as valid value
1225
# @define(kw_only=True)

packages/gooddata-sdk/src/gooddata_sdk/catalog/workspace/declarative_model/workspace/analytics_model/export_definition.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
from attrs import define
44
from gooddata_api_client.model.declarative_export_definition import DeclarativeExportDefinition
5-
from gooddata_api_client.model.declarative_export_definition_request_payload import (
6-
DeclarativeExportDefinitionRequestPayload,
7-
)
5+
from gooddata_api_client.model.export_request import ExportRequest
86

97
from gooddata_sdk import ExportCustomOverride, ExportSettings
108
from gooddata_sdk.catalog.base import Base
@@ -25,8 +23,8 @@ class CatalogDeclarativeExportDefinitionRequestPayload(Base):
2523
dashboard_id: str | None = None
2624

2725
@staticmethod
28-
def client_class() -> type[DeclarativeExportDefinitionRequestPayload]:
29-
return DeclarativeExportDefinitionRequestPayload
26+
def client_class() -> type[ExportRequest]:
27+
return ExportRequest
3028

3129

3230
@define(kw_only=True)

0 commit comments

Comments
 (0)