mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 17:43:35 -06:00
* update to alerting 20230418161049-5f374e58cb32 * rename renamed structs in https://github.com/grafana/alerting/pull/73 * update ValidateContactPoint to use BuildReceiverConfiguration * update logger factory according to changes * rewrite integration builder Co-authored-by: Santiago <santiagohernandez.1997@gmail.com>
23 lines
685 B
Go
23 lines
685 B
Go
package provisioning
|
|
|
|
import (
|
|
alertingNotify "github.com/grafana/alerting/notify"
|
|
|
|
"github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
|
|
)
|
|
|
|
func EmbeddedContactPointToGrafanaIntegrationConfig(e definitions.EmbeddedContactPoint) (alertingNotify.GrafanaIntegrationConfig, error) {
|
|
data, err := e.Settings.MarshalJSON()
|
|
if err != nil {
|
|
return alertingNotify.GrafanaIntegrationConfig{}, err
|
|
}
|
|
return alertingNotify.GrafanaIntegrationConfig{
|
|
UID: e.UID,
|
|
Name: e.Name,
|
|
Type: e.Type,
|
|
DisableResolveMessage: e.DisableResolveMessage,
|
|
Settings: data,
|
|
SecureSettings: nil,
|
|
}, nil
|
|
}
|