mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 11:34:26 +00:00
37 lines
686 B
Go
37 lines
686 B
Go
|
package iam
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/caos/zitadel/internal/eventstore/v2"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
IAMProjectSetEventType eventstore.EventType = "iam.project.iam.set"
|
||
|
)
|
||
|
|
||
|
type IAMProjectSetEvent struct {
|
||
|
eventstore.BaseEvent `json:"-"`
|
||
|
|
||
|
ProjectID string `json:"iamProjectId"`
|
||
|
}
|
||
|
|
||
|
func (e *IAMProjectSetEvent) CheckPrevious() bool {
|
||
|
return e.Type() == SetupStartedEventType
|
||
|
}
|
||
|
|
||
|
func (e *IAMProjectSetEvent) Data() interface{} {
|
||
|
return e
|
||
|
}
|
||
|
|
||
|
func NewIAMProjectSetEvent(ctx context.Context, service, projectID string) *IAMProjectSetEvent {
|
||
|
return &IAMProjectSetEvent{
|
||
|
BaseEvent: *eventstore.NewBaseEventForPush(
|
||
|
ctx,
|
||
|
service,
|
||
|
SetupDoneEventType,
|
||
|
),
|
||
|
ProjectID: projectID,
|
||
|
}
|
||
|
}
|