mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:07:31 +00:00
fix: rename iam to instance (#3345)
* fix: rename iam command side to instance * fix: rename iam command side to instance * fix: rename iam command side to instance * fix: rename iam command side to instance * fix: rename orgiampolicy to domain policy * fix: merge conflicts * fix: protos * fix: md files * implement deprecated org iam policy again Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
106
internal/repository/instance/debug_notification_file.go
Normal file
106
internal/repository/instance/debug_notification_file.go
Normal file
@@ -0,0 +1,106 @@
|
||||
package instance
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/caos/zitadel/internal/eventstore"
|
||||
"github.com/caos/zitadel/internal/repository/settings"
|
||||
|
||||
"github.com/caos/zitadel/internal/eventstore/repository"
|
||||
)
|
||||
|
||||
const (
|
||||
fileType = ".file"
|
||||
)
|
||||
|
||||
var (
|
||||
DebugNotificationProviderFileAddedEventType = instanceEventTypePrefix + settings.DebugNotificationPrefix + fileType + settings.DebugNotificationProviderAdded
|
||||
DebugNotificationProviderFileChangedEventType = instanceEventTypePrefix + settings.DebugNotificationPrefix + fileType + settings.DebugNotificationProviderChanged
|
||||
DebugNotificationProviderFileRemovedEventType = instanceEventTypePrefix + settings.DebugNotificationPrefix + fileType + settings.DebugNotificationProviderRemoved
|
||||
)
|
||||
|
||||
type DebugNotificationProviderFileAddedEvent struct {
|
||||
settings.DebugNotificationProviderAddedEvent
|
||||
}
|
||||
|
||||
func NewDebugNotificationProviderFileAddedEvent(
|
||||
ctx context.Context,
|
||||
aggregate *eventstore.Aggregate,
|
||||
compact bool,
|
||||
) *DebugNotificationProviderFileAddedEvent {
|
||||
return &DebugNotificationProviderFileAddedEvent{
|
||||
DebugNotificationProviderAddedEvent: *settings.NewDebugNotificationProviderAddedEvent(
|
||||
eventstore.NewBaseEventForPush(
|
||||
ctx,
|
||||
aggregate,
|
||||
DebugNotificationProviderFileAddedEventType),
|
||||
compact),
|
||||
}
|
||||
}
|
||||
|
||||
func DebugNotificationProviderFileAddedEventMapper(event *repository.Event) (eventstore.Event, error) {
|
||||
e, err := settings.DebugNotificationProviderAddedEventMapper(event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &DebugNotificationProviderFileAddedEvent{DebugNotificationProviderAddedEvent: *e.(*settings.DebugNotificationProviderAddedEvent)}, nil
|
||||
}
|
||||
|
||||
type DebugNotificationProviderFileChangedEvent struct {
|
||||
settings.DebugNotificationProviderChangedEvent
|
||||
}
|
||||
|
||||
func NewDebugNotificationProviderFileChangedEvent(
|
||||
ctx context.Context,
|
||||
aggregate *eventstore.Aggregate,
|
||||
changes []settings.DebugNotificationProviderChanges,
|
||||
) (*DebugNotificationProviderFileChangedEvent, error) {
|
||||
changedEvent, err := settings.NewDebugNotificationProviderChangedEvent(
|
||||
eventstore.NewBaseEventForPush(
|
||||
ctx,
|
||||
aggregate,
|
||||
DebugNotificationProviderFileChangedEventType),
|
||||
changes,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &DebugNotificationProviderFileChangedEvent{DebugNotificationProviderChangedEvent: *changedEvent}, nil
|
||||
}
|
||||
|
||||
func DebugNotificationProviderFileChangedEventMapper(event *repository.Event) (eventstore.Event, error) {
|
||||
e, err := settings.DebugNotificationProviderChangedEventMapper(event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &DebugNotificationProviderFileChangedEvent{DebugNotificationProviderChangedEvent: *e.(*settings.DebugNotificationProviderChangedEvent)}, nil
|
||||
}
|
||||
|
||||
type DebugNotificationProviderFileRemovedEvent struct {
|
||||
settings.DebugNotificationProviderRemovedEvent
|
||||
}
|
||||
|
||||
func NewDebugNotificationProviderFileRemovedEvent(
|
||||
ctx context.Context,
|
||||
aggregate *eventstore.Aggregate,
|
||||
) *DebugNotificationProviderFileRemovedEvent {
|
||||
return &DebugNotificationProviderFileRemovedEvent{
|
||||
DebugNotificationProviderRemovedEvent: *settings.NewDebugNotificationProviderRemovedEvent(
|
||||
eventstore.NewBaseEventForPush(
|
||||
ctx,
|
||||
aggregate,
|
||||
DebugNotificationProviderFileRemovedEventType),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
func DebugNotificationProviderFileRemovedEventMapper(event *repository.Event) (eventstore.Event, error) {
|
||||
e, err := settings.DebugNotificationProviderRemovedEventMapper(event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &DebugNotificationProviderFileRemovedEvent{DebugNotificationProviderRemovedEvent: *e.(*settings.DebugNotificationProviderRemovedEvent)}, nil
|
||||
}
|
Reference in New Issue
Block a user