forked from Ilhasoft/courier
-
Notifications
You must be signed in to change notification settings - Fork 1
/
channel_event.go
41 lines (32 loc) · 1.07 KB
/
channel_event.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
36
37
38
39
40
41
package courier
import (
"time"
"github.com/nyaruka/gocommon/urns"
)
// ChannelEventType is the type of channel event this is
type ChannelEventType string
// Possible values for ChannelEventTypes
const (
NewConversation ChannelEventType = "new_conversation"
Referral ChannelEventType = "referral"
StopContact ChannelEventType = "stop_contact"
WelcomeMessage ChannelEventType = "welcome_message"
)
//-----------------------------------------------------------------------------
// ChannelEvent Interface
//-----------------------------------------------------------------------------
// ChannelEvent represents an event on a channel, such as a follow, new conversation or referral
type ChannelEvent interface {
ChannelUUID() ChannelUUID
URN() urns.URN
EventType() ChannelEventType
Extra() map[string]interface{}
CreatedOn() time.Time
OccurredOn() time.Time
Logs() []*ChannelLog
AddLog(log *ChannelLog)
WithContactName(name string) ChannelEvent
WithExtra(extra map[string]interface{}) ChannelEvent
WithOccurredOn(time.Time) ChannelEvent
EventID() int64
}