-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #847 from gooddata/snapshot-master-1e7d9537-to-rel…
…/dev [bot] Merge master/1e7d9537 into rel/dev
- Loading branch information
Showing
19 changed files
with
1,315 additions
and
8 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
docs/content/en/latest/administration/notification-channels/_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: "Notification channels" | ||
linkTitle: "Notification channels" | ||
weight: 50 | ||
no_list: true | ||
--- | ||
|
||
Manage notification channels. | ||
|
||
Note that currently only Webhook is supported in Python SDK due to an issue in the generated API client. | ||
|
||
### Declarative Methods | ||
|
||
* [get_declarative_notification_channels](./get_declarative_notification_channels/) | ||
* [put_declarative_notification_channels](./put_declarative_notification_channels/) |
28 changes: 28 additions & 0 deletions
28
...t/administration/notification-channels/get_declarative_notification_channels.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: "get_declarative_notification_channels" | ||
linkTitle: "get_declarative_notification_channels..." | ||
weight: 190 | ||
no_list: true | ||
superheading: "catalog_organization." | ||
--- | ||
|
||
|
||
|
||
``get_declarative_notification_channels()`` | ||
|
||
Get all declarative notification channels in the current organization. | ||
|
||
{{% parameters-block title="Parameters" None="yes" %}} | ||
{{% /parameters-block %}} | ||
|
||
{{% parameters-block title="Returns" %}} | ||
{{< parameter p_type="list[CatalogDeclarativeNotificationChannel]" >}} | ||
List of declarative notification channels. | ||
{{< /parameter >}} | ||
{{% /parameters-block %}} | ||
|
||
## Example | ||
|
||
```python | ||
sdk.catalog_organization.get_declarative_notification_channels() | ||
``` |
33 changes: 33 additions & 0 deletions
33
...t/administration/notification-channels/put_declarative_notification_channels.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: "put_declarative_notification_channels" | ||
linkTitle: "put_declarative_notification_channels..." | ||
weight: 190 | ||
no_list: true | ||
superheading: "catalog_organization." | ||
--- | ||
|
||
|
||
|
||
``put_declarative_notification_channels(notification_channels: list[CatalogDeclarativeNotificationChannel])`` | ||
|
||
Put declarative notification channels in the current organization. | ||
|
||
{{% parameters-block title="Parameters"%}} | ||
{{< parameter p_name="notification_channels" p_type="list[CatalogDeclarativeNotificationChannel]" >}} | ||
List of declarative notification channels. | ||
{{< /parameter >}} | ||
{{% /parameters-block %}} | ||
|
||
{{% parameters-block title="Returns" None="yes" %}} | ||
{{% /parameters-block %}} | ||
|
||
## Example | ||
|
||
```python | ||
from gooddata_sdk import CatalogDeclarativeNotificationChannel, CatalogWebhook | ||
|
||
notification_channels = [CatalogDeclarativeNotificationChannel( | ||
id="webhook", name="Webhook", destination=CatalogWebhook(url="https://webhook.site", token="123") | ||
)] | ||
sdk.catalog_organization.put_declarative_notification_channels() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
docs/content/en/latest/workspace/workspaces/get_declarative_automations.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: "get_declarative_automations" | ||
linkTitle: "get_declarative_automations" | ||
weight: 50 | ||
superheading: "catalog_workspace." | ||
--- | ||
|
||
``get_declarative_automations(workspace_id: str)`` | ||
|
||
Gets the layout of all workspaces and their hierarchy. | ||
|
||
{{% parameters-block title="Parameters" %}} | ||
{{< parameter p_name="workspace_id" p_type="string" >}} | ||
Workspace identification string e.g. "demo" | ||
{{< /parameter >}} | ||
{{% /parameters-block %}} | ||
|
||
{{% parameters-block title="Returns" %}} | ||
{{< parameter p_type="list[CatalogDeclarativeAutomation]" >}} | ||
Retrieve a list of declarative automations. | ||
{{< /parameter >}} | ||
{{% /parameters-block %}} | ||
|
||
## Example | ||
|
||
```python | ||
declarative_automations = sdk.catalog_workspace.get_declarative_automations(workspace_id="demo") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
docs/content/en/latest/workspace/workspaces/put_declarative_automations.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: "put_declarative_automations" | ||
linkTitle: "put_declarative_automations" | ||
weight: 50 | ||
superheading: "catalog_workspace." | ||
--- | ||
|
||
``put_declarative_automations(workspace_id: str, automations: list[CatalogDeclarativeAutomation])`` | ||
|
||
Set automations for the workspace. | ||
|
||
{{% parameters-block title="Parameters" %}} | ||
{{< parameter p_name="workspace_id" p_type="string" >}} | ||
Workspace identification string e.g. "demo" | ||
{{< /parameter >}} | ||
{{< parameter p_name="automations" p_type="list[CatalogDeclarativeAutomation]" >}} | ||
List of declarative automations. | ||
{{< /parameter >}} | ||
{{% /parameters-block %}} | ||
|
||
{{% parameters-block title="Returns" None="yes" %}} | ||
{{% /parameters-block %}} | ||
|
||
## Example | ||
|
||
```python | ||
automations = [CatalogDeclarativeAutomation(id="schedule", ...)] | ||
sdk.catalog_workspace.put_declarative_automations(workspace_id="demo", automations=automations) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
gooddata-sdk/gooddata_sdk/catalog/organization/layout/notification_channel.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# (C) 2024 GoodData Corporation | ||
import builtins | ||
from typing import Optional | ||
|
||
from attrs import define, field | ||
from gooddata_api_client.model.declarative_notification_channel import DeclarativeNotificationChannel | ||
from gooddata_api_client.model.webhook import Webhook | ||
from gooddata_sdk.catalog.base import Base | ||
|
||
# TODO: there is an issue with generated client which causes these two classes to fail | ||
# type in gooddata_api_client/model/declarative_notification_channel_destination.py contains only WEBHOOK as valid value | ||
# @define(auto_attribs=True, kw_only=True) | ||
# class CatalogDefaultSmtp(Base): | ||
# from_email: Optional[str] = None | ||
# from_email_name: Optional[str] = None | ||
# | ||
# @staticmethod | ||
# def client_class() -> Type[DefaultSmtp]: | ||
# return DefaultSmtp | ||
# | ||
# | ||
# @define(auto_attribs=True, kw_only=True) | ||
# class CatalogSmtp(Base): | ||
# from_email: Optional[str] = None | ||
# from_email_name: Optional[str] = None | ||
# host: Optional[str] = None | ||
# password: Optional[str] = None | ||
# port: Optional[int] = None | ||
# username: Optional[str] = None | ||
# | ||
# @staticmethod | ||
# def client_class() -> Type[Smtp]: | ||
# return Smtp | ||
|
||
|
||
@define(auto_attribs=True, kw_only=True) | ||
class CatalogWebhook(Base): | ||
type: str = field(default="WEBHOOK", init=False) | ||
url: Optional[str] = None | ||
token: Optional[str] = field(default=None, eq=False) | ||
has_token: Optional[bool] = field(default=None, eq=False) | ||
|
||
@staticmethod | ||
def client_class() -> builtins.type[Webhook]: | ||
return Webhook | ||
|
||
|
||
@define(auto_attribs=True, kw_only=True) | ||
class CatalogDeclarativeNotificationChannel(Base): | ||
id: str | ||
name: Optional[str] = None | ||
description: Optional[str] = None | ||
destination_type: Optional[str] = None | ||
custom_dashboard_url: Optional[str] = None | ||
enable_multiple_recipients: Optional[bool] = None | ||
# destination: Optional[Union[CatalogDefaultSmtp, CatalogSmtp, CatalogWebhook]] = None | ||
destination: Optional[CatalogWebhook] = None | ||
|
||
@staticmethod | ||
def client_class() -> builtins.type[DeclarativeNotificationChannel]: | ||
return DeclarativeNotificationChannel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.