2020-11-06 16:25:07 +00:00
|
|
|
package iam
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/caos/zitadel/internal/eventstore/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
GlobalOrgSetEventType eventstore.EventType = "iam.global.org.set"
|
|
|
|
)
|
|
|
|
|
|
|
|
type GlobalOrgSetEvent struct {
|
|
|
|
eventstore.BaseEvent `json:"-"`
|
|
|
|
|
|
|
|
OrgID string `json:"globalOrgId"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *GlobalOrgSetEvent) CheckPrevious() bool {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *GlobalOrgSetEvent) Data() interface{} {
|
|
|
|
return e
|
|
|
|
}
|
|
|
|
|
2020-11-06 21:09:19 +00:00
|
|
|
func NewGlobalOrgSetEventEvent(ctx context.Context, orgID string) *GlobalOrgSetEvent {
|
2020-11-06 16:25:07 +00:00
|
|
|
return &GlobalOrgSetEvent{
|
|
|
|
BaseEvent: *eventstore.NewBaseEventForPush(
|
|
|
|
ctx,
|
|
|
|
GlobalOrgSetEventType,
|
|
|
|
),
|
|
|
|
OrgID: orgID,
|
|
|
|
}
|
|
|
|
}
|