2021-09-27 13:43:49 +02:00
|
|
|
package domain
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/caos/zitadel/internal/eventstore/v1/models"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Action struct {
|
|
|
|
models.ObjectRoot
|
|
|
|
|
|
|
|
Name string
|
|
|
|
Script string
|
|
|
|
Timeout time.Duration
|
|
|
|
AllowedToFail bool
|
|
|
|
State ActionState
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *Action) IsValid() bool {
|
|
|
|
return a.Name != ""
|
|
|
|
}
|
|
|
|
|
|
|
|
type ActionState int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
ActionStateUnspecified ActionState = iota
|
|
|
|
ActionStateActive
|
|
|
|
ActionStateInactive
|
|
|
|
ActionStateRemoved
|
|
|
|
actionStateCount
|
|
|
|
)
|
|
|
|
|
|
|
|
func (s ActionState) Valid() bool {
|
|
|
|
return s >= 0 && s < actionStateCount
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s ActionState) Exists() bool {
|
|
|
|
return s != ActionStateUnspecified && s != ActionStateRemoved
|
|
|
|
}
|
2022-02-02 09:04:05 +01:00
|
|
|
|
|
|
|
type ActionsAllowed int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
ActionsNotAllowed ActionsAllowed = iota
|
|
|
|
ActionsMaxAllowed
|
|
|
|
ActionsAllowedUnlimited
|
|
|
|
)
|