2
0

notification.go 419 B

1234567891011121314151617181920212223
  1. package models
  2. import (
  3. "github.com/porter-dev/porter/api/types"
  4. "gorm.io/gorm"
  5. )
  6. type NotificationConfig struct {
  7. gorm.Model
  8. Enabled bool // if notifications are enabled at all
  9. Success bool
  10. Failure bool
  11. }
  12. func (conf *NotificationConfig) ToNotificationConfigType() *types.NotificationConfig {
  13. return &types.NotificationConfig{
  14. Enabled: conf.Enabled,
  15. Success: conf.Success,
  16. Failure: conf.Failure,
  17. }
  18. }