411f56b51b
Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
16 lines
387 B
Go
16 lines
387 B
Go
package automation
|
|
|
|
import "fmt"
|
|
|
|
func validateTriggerCombination(kinds []TriggerType) error {
|
|
var scheduled, plugin bool
|
|
for _, kind := range kinds {
|
|
scheduled = scheduled || kind == TriggerTypeScheduled
|
|
plugin = plugin || kind == TriggerTypePluginEvent
|
|
}
|
|
if scheduled && plugin {
|
|
return fmt.Errorf("scheduled and plugin event conditions cannot be combined")
|
|
}
|
|
return nil
|
|
}
|