forked from nyaruka/goflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
remove_from_group.go
35 lines (30 loc) · 1005 Bytes
/
remove_from_group.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package events
import "github.com/nyaruka/goflow/flows"
// TypeRemoveFromGroup is the type fo our remove from group action
const TypeRemoveFromGroup string = "remove_from_group"
// RemoveFromGroupEvent events are created when a contact is removed from one or more
// groups.
//
// ```
// {
// "step_uuid": "8eebd020-1af5-431c-b943-aa670fc74da9",
// "created_on": "2006-01-02T15:04:05Z",
// "type": "remove_from_group",
// "groups": [{
// "name": "Survey Audience",
// "uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d"
// }]
// }
// ```
//
// @event remove_from_group
type RemoveFromGroupEvent struct {
Groups []*flows.Group `json:"groups" validate:"required,min=1"`
BaseEvent
}
// NewRemoveFromGroup returns a new remove from group event
func NewRemoveFromGroup(groups []*flows.Group) *RemoveFromGroupEvent {
return &RemoveFromGroupEvent{Groups: groups}
}
// Type returns the type of this event
func (e *RemoveFromGroupEvent) Type() string { return TypeRemoveFromGroup }