forked from zitadel/zitadel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotification_provider.go
32 lines (26 loc) · 1.18 KB
/
notification_provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package admin
import (
"context"
"github.com/dennigogo/zitadel/internal/api/authz"
"github.com/dennigogo/zitadel/internal/api/grpc/settings"
"github.com/dennigogo/zitadel/internal/domain"
admin_pb "github.com/dennigogo/zitadel/pkg/grpc/admin"
)
func (s *Server) GetFileSystemNotificationProvider(ctx context.Context, req *admin_pb.GetFileSystemNotificationProviderRequest) (*admin_pb.GetFileSystemNotificationProviderResponse, error) {
result, err := s.query.NotificationProviderByIDAndType(ctx, authz.GetInstance(ctx).InstanceID(), domain.NotificationProviderTypeFile)
if err != nil {
return nil, err
}
return &admin_pb.GetFileSystemNotificationProviderResponse{
Provider: settings.NotificationProviderToPb(result),
}, nil
}
func (s *Server) GetLogNotificationProvider(ctx context.Context, req *admin_pb.GetLogNotificationProviderRequest) (*admin_pb.GetLogNotificationProviderResponse, error) {
result, err := s.query.NotificationProviderByIDAndType(ctx, authz.GetInstance(ctx).InstanceID(), domain.NotificationProviderTypeLog)
if err != nil {
return nil, err
}
return &admin_pb.GetLogNotificationProviderResponse{
Provider: settings.NotificationProviderToPb(result),
}, nil
}