Documentation ¶
Index ¶
- Constants
- func EventFromEnvelope(envelope *utils.TypedEnvelope) (flows.Event, error)
- func EventsToEnvelopes(events []flows.Event) ([]*utils.TypedEnvelope, error)
- func ReadEvents(envelopes []*utils.TypedEnvelope) ([]flows.Event, error)
- type BroadcastCreatedEvent
- func (e *BroadcastCreatedEvent) AllowedOrigin() flows.EventOrigin
- func (e *BroadcastCreatedEvent) Apply(run flows.FlowRun) error
- func (e *BroadcastCreatedEvent) CreatedOn() time.Time
- func (e *BroadcastCreatedEvent) FromCaller() bool
- func (e *BroadcastCreatedEvent) SetCreatedOn(time time.Time)
- func (e *BroadcastCreatedEvent) SetFromCaller(fromCaller bool)
- func (e *BroadcastCreatedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *BroadcastCreatedEvent) StepUUID() flows.StepUUID
- func (e *BroadcastCreatedEvent) Type() string
- func (e *BroadcastCreatedEvent) Validate(assets flows.SessionAssets) error
- type BroadcastTranslation
- type ContactChangedEvent
- func (e *ContactChangedEvent) AllowedOrigin() flows.EventOrigin
- func (e *ContactChangedEvent) Apply(run flows.FlowRun) error
- func (e *ContactChangedEvent) CreatedOn() time.Time
- func (e *ContactChangedEvent) FromCaller() bool
- func (e *ContactChangedEvent) SetCreatedOn(time time.Time)
- func (e *ContactChangedEvent) SetFromCaller(fromCaller bool)
- func (e *ContactChangedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *ContactChangedEvent) StepUUID() flows.StepUUID
- func (e *ContactChangedEvent) Type() string
- func (e *ContactChangedEvent) Validate(assets flows.SessionAssets) error
- type ContactChannelChangedEvent
- func (e *ContactChannelChangedEvent) AllowedOrigin() flows.EventOrigin
- func (e *ContactChannelChangedEvent) Apply(run flows.FlowRun) error
- func (e *ContactChannelChangedEvent) CreatedOn() time.Time
- func (e *ContactChannelChangedEvent) FromCaller() bool
- func (e *ContactChannelChangedEvent) SetCreatedOn(time time.Time)
- func (e *ContactChannelChangedEvent) SetFromCaller(fromCaller bool)
- func (e *ContactChannelChangedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *ContactChannelChangedEvent) StepUUID() flows.StepUUID
- func (e *ContactChannelChangedEvent) Type() string
- func (e *ContactChannelChangedEvent) Validate(assets flows.SessionAssets) error
- type ContactFieldChangedEvent
- func (e *ContactFieldChangedEvent) AllowedOrigin() flows.EventOrigin
- func (e *ContactFieldChangedEvent) Apply(run flows.FlowRun) error
- func (e *ContactFieldChangedEvent) CreatedOn() time.Time
- func (e *ContactFieldChangedEvent) FromCaller() bool
- func (e *ContactFieldChangedEvent) SetCreatedOn(time time.Time)
- func (e *ContactFieldChangedEvent) SetFromCaller(fromCaller bool)
- func (e *ContactFieldChangedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *ContactFieldChangedEvent) StepUUID() flows.StepUUID
- func (e *ContactFieldChangedEvent) Type() string
- func (e *ContactFieldChangedEvent) Validate(assets flows.SessionAssets) error
- type ContactGroupsAddedEvent
- func (e *ContactGroupsAddedEvent) AllowedOrigin() flows.EventOrigin
- func (e *ContactGroupsAddedEvent) Apply(run flows.FlowRun) error
- func (e *ContactGroupsAddedEvent) CreatedOn() time.Time
- func (e *ContactGroupsAddedEvent) FromCaller() bool
- func (e *ContactGroupsAddedEvent) SetCreatedOn(time time.Time)
- func (e *ContactGroupsAddedEvent) SetFromCaller(fromCaller bool)
- func (e *ContactGroupsAddedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *ContactGroupsAddedEvent) StepUUID() flows.StepUUID
- func (e *ContactGroupsAddedEvent) Type() string
- func (e *ContactGroupsAddedEvent) Validate(assets flows.SessionAssets) error
- type ContactGroupsRemovedEvent
- func (e *ContactGroupsRemovedEvent) AllowedOrigin() flows.EventOrigin
- func (e *ContactGroupsRemovedEvent) Apply(run flows.FlowRun) error
- func (e *ContactGroupsRemovedEvent) CreatedOn() time.Time
- func (e *ContactGroupsRemovedEvent) FromCaller() bool
- func (e *ContactGroupsRemovedEvent) SetCreatedOn(time time.Time)
- func (e *ContactGroupsRemovedEvent) SetFromCaller(fromCaller bool)
- func (e *ContactGroupsRemovedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *ContactGroupsRemovedEvent) StepUUID() flows.StepUUID
- func (e *ContactGroupsRemovedEvent) Type() string
- func (e *ContactGroupsRemovedEvent) Validate(assets flows.SessionAssets) error
- type ContactPropertyChangedEvent
- func (e *ContactPropertyChangedEvent) AllowedOrigin() flows.EventOrigin
- func (e *ContactPropertyChangedEvent) Apply(run flows.FlowRun) error
- func (e *ContactPropertyChangedEvent) CreatedOn() time.Time
- func (e *ContactPropertyChangedEvent) FromCaller() bool
- func (e *ContactPropertyChangedEvent) SetCreatedOn(time time.Time)
- func (e *ContactPropertyChangedEvent) SetFromCaller(fromCaller bool)
- func (e *ContactPropertyChangedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *ContactPropertyChangedEvent) StepUUID() flows.StepUUID
- func (e *ContactPropertyChangedEvent) Type() string
- func (e *ContactPropertyChangedEvent) Validate(assets flows.SessionAssets) error
- type ContactURNAddedEvent
- func (e *ContactURNAddedEvent) AllowedOrigin() flows.EventOrigin
- func (e *ContactURNAddedEvent) Apply(run flows.FlowRun) error
- func (e *ContactURNAddedEvent) CreatedOn() time.Time
- func (e *ContactURNAddedEvent) FromCaller() bool
- func (e *ContactURNAddedEvent) SetCreatedOn(time time.Time)
- func (e *ContactURNAddedEvent) SetFromCaller(fromCaller bool)
- func (e *ContactURNAddedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *ContactURNAddedEvent) StepUUID() flows.StepUUID
- func (e *ContactURNAddedEvent) Type() string
- func (e *ContactURNAddedEvent) Validate(assets flows.SessionAssets) error
- type EmailCreatedEvent
- func (e *EmailCreatedEvent) AllowedOrigin() flows.EventOrigin
- func (e *EmailCreatedEvent) Apply(run flows.FlowRun) error
- func (e *EmailCreatedEvent) CreatedOn() time.Time
- func (e *EmailCreatedEvent) FromCaller() bool
- func (e *EmailCreatedEvent) SetCreatedOn(time time.Time)
- func (e *EmailCreatedEvent) SetFromCaller(fromCaller bool)
- func (e *EmailCreatedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *EmailCreatedEvent) StepUUID() flows.StepUUID
- func (e *EmailCreatedEvent) Type() string
- func (e *EmailCreatedEvent) Validate(assets flows.SessionAssets) error
- type EnvironmentChangedEvent
- func (e *EnvironmentChangedEvent) AllowedOrigin() flows.EventOrigin
- func (e *EnvironmentChangedEvent) Apply(run flows.FlowRun) error
- func (e *EnvironmentChangedEvent) CreatedOn() time.Time
- func (e *EnvironmentChangedEvent) FromCaller() bool
- func (e *EnvironmentChangedEvent) SetCreatedOn(time time.Time)
- func (e *EnvironmentChangedEvent) SetFromCaller(fromCaller bool)
- func (e *EnvironmentChangedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *EnvironmentChangedEvent) StepUUID() flows.StepUUID
- func (e *EnvironmentChangedEvent) Type() string
- func (e *EnvironmentChangedEvent) Validate(assets flows.SessionAssets) error
- type ErrorEvent
- func (e *ErrorEvent) AllowedOrigin() flows.EventOrigin
- func (e *ErrorEvent) Apply(run flows.FlowRun) error
- func (e *ErrorEvent) CreatedOn() time.Time
- func (e *ErrorEvent) FromCaller() bool
- func (e *ErrorEvent) SetCreatedOn(time time.Time)
- func (e *ErrorEvent) SetFromCaller(fromCaller bool)
- func (e *ErrorEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *ErrorEvent) StepUUID() flows.StepUUID
- func (e *ErrorEvent) Type() string
- func (e *ErrorEvent) Validate(assets flows.SessionAssets) error
- type FlowTriggeredEvent
- func (e *FlowTriggeredEvent) AllowedOrigin() flows.EventOrigin
- func (e *FlowTriggeredEvent) Apply(run flows.FlowRun) error
- func (e *FlowTriggeredEvent) CreatedOn() time.Time
- func (e *FlowTriggeredEvent) FromCaller() bool
- func (e *FlowTriggeredEvent) SetCreatedOn(time time.Time)
- func (e *FlowTriggeredEvent) SetFromCaller(fromCaller bool)
- func (e *FlowTriggeredEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *FlowTriggeredEvent) StepUUID() flows.StepUUID
- func (e *FlowTriggeredEvent) Type() string
- func (e *FlowTriggeredEvent) Validate(assets flows.SessionAssets) error
- type InputLabelsAddedEvent
- func (e *InputLabelsAddedEvent) AllowedOrigin() flows.EventOrigin
- func (e *InputLabelsAddedEvent) Apply(run flows.FlowRun) error
- func (e *InputLabelsAddedEvent) CreatedOn() time.Time
- func (e *InputLabelsAddedEvent) FromCaller() bool
- func (e *InputLabelsAddedEvent) SetCreatedOn(time time.Time)
- func (e *InputLabelsAddedEvent) SetFromCaller(fromCaller bool)
- func (e *InputLabelsAddedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *InputLabelsAddedEvent) StepUUID() flows.StepUUID
- func (e *InputLabelsAddedEvent) Type() string
- func (e *InputLabelsAddedEvent) Validate(assets flows.SessionAssets) error
- type MsgCreatedEvent
- func (e *MsgCreatedEvent) AllowedOrigin() flows.EventOrigin
- func (e *MsgCreatedEvent) Apply(run flows.FlowRun) error
- func (e *MsgCreatedEvent) CreatedOn() time.Time
- func (e *MsgCreatedEvent) FromCaller() bool
- func (e *MsgCreatedEvent) SetCreatedOn(time time.Time)
- func (e *MsgCreatedEvent) SetFromCaller(fromCaller bool)
- func (e *MsgCreatedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *MsgCreatedEvent) StepUUID() flows.StepUUID
- func (e *MsgCreatedEvent) Type() string
- func (e *MsgCreatedEvent) Validate(assets flows.SessionAssets) error
- type MsgReceivedEvent
- func (e *MsgReceivedEvent) AllowedOrigin() flows.EventOrigin
- func (e *MsgReceivedEvent) Apply(run flows.FlowRun) error
- func (e *MsgReceivedEvent) CreatedOn() time.Time
- func (e *MsgReceivedEvent) FromCaller() bool
- func (e *MsgReceivedEvent) SetCreatedOn(time time.Time)
- func (e *MsgReceivedEvent) SetFromCaller(fromCaller bool)
- func (e *MsgReceivedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *MsgReceivedEvent) StepUUID() flows.StepUUID
- func (e *MsgReceivedEvent) Type() string
- func (e *MsgReceivedEvent) Validate(assets flows.SessionAssets) error
- type MsgWaitEvent
- func (e *MsgWaitEvent) AllowedOrigin() flows.EventOrigin
- func (e *MsgWaitEvent) Apply(run flows.FlowRun) error
- func (e *MsgWaitEvent) CreatedOn() time.Time
- func (e *MsgWaitEvent) FromCaller() bool
- func (e *MsgWaitEvent) SetCreatedOn(time time.Time)
- func (e *MsgWaitEvent) SetFromCaller(fromCaller bool)
- func (e *MsgWaitEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *MsgWaitEvent) StepUUID() flows.StepUUID
- func (e *MsgWaitEvent) Type() string
- func (e *MsgWaitEvent) Validate(assets flows.SessionAssets) error
- type NothingWaitEvent
- func (e *NothingWaitEvent) AllowedOrigin() flows.EventOrigin
- func (e *NothingWaitEvent) Apply(run flows.FlowRun) error
- func (e *NothingWaitEvent) CreatedOn() time.Time
- func (e *NothingWaitEvent) FromCaller() bool
- func (e *NothingWaitEvent) SetCreatedOn(time time.Time)
- func (e *NothingWaitEvent) SetFromCaller(fromCaller bool)
- func (e *NothingWaitEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *NothingWaitEvent) StepUUID() flows.StepUUID
- func (e *NothingWaitEvent) Type() string
- func (e *NothingWaitEvent) Validate(assets flows.SessionAssets) error
- type RunExpiredEvent
- func (e *RunExpiredEvent) AllowedOrigin() flows.EventOrigin
- func (e *RunExpiredEvent) Apply(run flows.FlowRun) error
- func (e *RunExpiredEvent) CreatedOn() time.Time
- func (e *RunExpiredEvent) FromCaller() bool
- func (e *RunExpiredEvent) SetCreatedOn(time time.Time)
- func (e *RunExpiredEvent) SetFromCaller(fromCaller bool)
- func (e *RunExpiredEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *RunExpiredEvent) StepUUID() flows.StepUUID
- func (e *RunExpiredEvent) Type() string
- func (e *RunExpiredEvent) Validate(assets flows.SessionAssets) error
- type RunResultChangedEvent
- func (e *RunResultChangedEvent) AllowedOrigin() flows.EventOrigin
- func (e *RunResultChangedEvent) Apply(run flows.FlowRun) error
- func (e *RunResultChangedEvent) CreatedOn() time.Time
- func (e *RunResultChangedEvent) FromCaller() bool
- func (e *RunResultChangedEvent) SetCreatedOn(time time.Time)
- func (e *RunResultChangedEvent) SetFromCaller(fromCaller bool)
- func (e *RunResultChangedEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *RunResultChangedEvent) StepUUID() flows.StepUUID
- func (e *RunResultChangedEvent) Type() string
- func (e *RunResultChangedEvent) Validate(assets flows.SessionAssets) error
- type SessionTriggeredEvent
- func (e *SessionTriggeredEvent) AllowedOrigin() flows.EventOrigin
- func (e *SessionTriggeredEvent) Apply(run flows.FlowRun) error
- func (e *SessionTriggeredEvent) CreatedOn() time.Time
- func (e *SessionTriggeredEvent) FromCaller() bool
- func (e *SessionTriggeredEvent) SetCreatedOn(time time.Time)
- func (e *SessionTriggeredEvent) SetFromCaller(fromCaller bool)
- func (e *SessionTriggeredEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *SessionTriggeredEvent) StepUUID() flows.StepUUID
- func (e *SessionTriggeredEvent) Type() string
- func (e *SessionTriggeredEvent) Validate(assets flows.SessionAssets) error
- type WebhookCalledEvent
- func (e *WebhookCalledEvent) AllowedOrigin() flows.EventOrigin
- func (e *WebhookCalledEvent) Apply(run flows.FlowRun) error
- func (e *WebhookCalledEvent) CreatedOn() time.Time
- func (e *WebhookCalledEvent) FromCaller() bool
- func (e *WebhookCalledEvent) SetCreatedOn(time time.Time)
- func (e *WebhookCalledEvent) SetFromCaller(fromCaller bool)
- func (e *WebhookCalledEvent) SetStepUUID(stepUUID flows.StepUUID)
- func (e *WebhookCalledEvent) StepUUID() flows.StepUUID
- func (e *WebhookCalledEvent) Type() string
- func (e *WebhookCalledEvent) Validate(assets flows.SessionAssets) error
Constants ¶
const TypeBroadcastCreated string = "broadcast_created"
TypeBroadcastCreated is a constant for outgoing message events
const TypeContactChanged string = "contact_changed"
TypeContactChanged is the type of our set contact event
const TypeContactChannelChanged string = "contact_channel_changed"
TypeContactChannelChanged is the type of our set preferred channel event
const TypeContactFieldChanged string = "contact_field_changed"
TypeContactFieldChanged is the type of our save to contact event
const TypeContactGroupsAdded string = "contact_groups_added"
TypeContactGroupsAdded is the type of our add to group action
const TypeContactGroupsRemoved string = "contact_groups_removed"
TypeContactGroupsRemoved is the type fo our remove from group action
const TypeContactPropertyChanged string = "contact_property_changed"
TypeContactPropertyChanged is the type of our update contact event
const TypeContactURNAdded string = "contact_urn_added"
TypeContactURNAdded is the type of our add URN event
const TypeEmailCreated string = "email_created"
TypeEmailCreated is our type for the email event
const TypeEnvironmentChanged string = "environment_changed"
TypeEnvironmentChanged is the type of our environment changed event
const TypeError string = "error"
TypeError is the type of our error events
const TypeFlowTriggered string = "flow_triggered"
TypeFlowTriggered is the type of our flow triggered event
const TypeInputLabelsAdded string = "input_labels_added"
TypeInputLabelsAdded is the type of our add label action
const TypeMsgCreated string = "msg_created"
TypeMsgCreated is a constant for incoming messages
const TypeMsgReceived string = "msg_received"
TypeMsgReceived is a constant for incoming messages
const TypeMsgWait string = "msg_wait"
TypeMsgWait is the type of our msg wait event
const TypeNothingWait string = "nothing_wait"
TypeNothingWait is the type of our nothing wait event
const TypeRunExpired string = "run_expired"
TypeRunExpired is the type of our flow expired event
const TypeRunResultChanged string = "run_result_changed"
TypeRunResultChanged is the type of our run result event
const TypeSessionTriggered string = "session_triggered"
TypeSessionTriggered is the type of our session triggered event
const TypeWebhookCalled string = "webhook_called"
TypeWebhookCalled is the type for our webhook events
Variables ¶
This section is empty.
Functions ¶
func EventFromEnvelope ¶
func EventFromEnvelope(envelope *utils.TypedEnvelope) (flows.Event, error)
EventFromEnvelope reads a single event from the given envelope
func EventsToEnvelopes ¶ added in v0.7.0
func EventsToEnvelopes(events []flows.Event) ([]*utils.TypedEnvelope, error)
EventsToEnvelopes converts the given events to typed envelopes
func ReadEvents ¶ added in v0.4.0
func ReadEvents(envelopes []*utils.TypedEnvelope) ([]flows.Event, error)
ReadEvents reads the events from the given envelopes
Types ¶
type BroadcastCreatedEvent ¶ added in v0.5.0
type BroadcastCreatedEvent struct { Translations map[utils.Language]*BroadcastTranslation `json:"translations,min=1" validate:"dive"` BaseLanguage utils.Language `json:"base_language" validate:"required"` URNs []urns.URN `json:"urns,omitempty" validate:"dive,urn"` Contacts []*flows.ContactReference `json:"contacts,omitempty" validate:"dive"` Groups []*flows.GroupReference `json:"groups,omitempty" validate:"dive"` // contains filtered or unexported fields }
BroadcastCreatedEvent events are created for outgoing broadcasts.
{ "type": "broadcast_created", "created_on": "2006-01-02T15:04:05Z", "translations": { "eng": { "text": "hi, what's up", "attachments": [], "quick_replies": ["All good", "Got 99 problems"] }, "spa": { "text": "Que pasa", "attachments": [], "quick_replies": ["Todo bien", "Tengo 99 problemas"] } }, "base_language": "eng", "urns": ["tel:+12065551212"], "contacts": [{"uuid": "0e06f977-cbb7-475f-9d0b-a0c4aaec7f6a", "name": "Bob"}] }
@event broadcast_created
func NewBroadcastCreatedEvent ¶ added in v0.5.0
func NewBroadcastCreatedEvent(translations map[utils.Language]*BroadcastTranslation, baseLanguage utils.Language, urns []urns.URN, contacts []*flows.ContactReference, groups []*flows.GroupReference) *BroadcastCreatedEvent
NewBroadcastCreatedEvent creates a new outgoing msg event for the given recipients
func (*BroadcastCreatedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *BroadcastCreatedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*BroadcastCreatedEvent) Apply ¶ added in v0.5.0
func (e *BroadcastCreatedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*BroadcastCreatedEvent) FromCaller ¶ added in v0.6.2
func (e *BroadcastCreatedEvent) FromCaller() bool
func (*BroadcastCreatedEvent) SetCreatedOn ¶ added in v0.6.2
func (*BroadcastCreatedEvent) SetFromCaller ¶ added in v0.6.2
func (e *BroadcastCreatedEvent) SetFromCaller(fromCaller bool)
func (*BroadcastCreatedEvent) SetStepUUID ¶ added in v0.7.0
func (*BroadcastCreatedEvent) Type ¶ added in v0.5.0
func (e *BroadcastCreatedEvent) Type() string
Type returns the type of this event
func (*BroadcastCreatedEvent) Validate ¶ added in v0.6.0
func (e *BroadcastCreatedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs. We assume engine generated events are valid.
type BroadcastTranslation ¶ added in v0.6.1
type BroadcastTranslation struct { Text string `json:"text"` Attachments []flows.Attachment `json:"attachments,omitempty"` QuickReplies []string `json:"quick_replies,omitempty"` }
BroadcastTranslation is the broadcast content in a particular language
type ContactChangedEvent ¶ added in v0.5.0
type ContactChangedEvent struct { Contact json.RawMessage `json:"contact"` // contains filtered or unexported fields }
ContactChangedEvent events are created to set a contact on a session
{ "type": "contact_changed", "created_on": "2006-01-02T15:04:05Z", "contact": { "uuid": "0e06f977-cbb7-475f-9d0b-a0c4aaec7f6a", "name": "Bob", "urns": ["tel:+11231234567"] } }
@event contact_changed
func (*ContactChangedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *ContactChangedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*ContactChangedEvent) Apply ¶ added in v0.5.0
func (e *ContactChangedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*ContactChangedEvent) FromCaller ¶ added in v0.6.2
func (e *ContactChangedEvent) FromCaller() bool
func (*ContactChangedEvent) SetCreatedOn ¶ added in v0.6.2
func (*ContactChangedEvent) SetFromCaller ¶ added in v0.6.2
func (e *ContactChangedEvent) SetFromCaller(fromCaller bool)
func (*ContactChangedEvent) SetStepUUID ¶ added in v0.7.0
func (*ContactChangedEvent) Type ¶ added in v0.5.0
func (e *ContactChangedEvent) Type() string
Type returns the type of this event
func (*ContactChangedEvent) Validate ¶ added in v0.6.0
func (e *ContactChangedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type ContactChannelChangedEvent ¶ added in v0.5.0
type ContactChannelChangedEvent struct { Channel *flows.ChannelReference `json:"channel" validate:"required"` // contains filtered or unexported fields }
ContactChannelChangedEvent events are created when a contact's preferred channel is changed.
{ "type": "contact_channel_changed", "created_on": "2006-01-02T15:04:05Z", "channel": {"uuid": "67a3ac69-e5e0-4ef0-8423-eddf71a71472", "name": "Twilio"} }
@event contact_channel_changed
func NewContactChannelChangedEvent ¶ added in v0.5.0
func NewContactChannelChangedEvent(channel *flows.ChannelReference) *ContactChannelChangedEvent
NewContactChannelChangedEvent returns a new preferred channel event
func (*ContactChannelChangedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *ContactChannelChangedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*ContactChannelChangedEvent) Apply ¶ added in v0.5.0
func (e *ContactChannelChangedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*ContactChannelChangedEvent) FromCaller ¶ added in v0.6.2
func (e *ContactChannelChangedEvent) FromCaller() bool
func (*ContactChannelChangedEvent) SetCreatedOn ¶ added in v0.6.2
func (*ContactChannelChangedEvent) SetFromCaller ¶ added in v0.6.2
func (e *ContactChannelChangedEvent) SetFromCaller(fromCaller bool)
func (*ContactChannelChangedEvent) SetStepUUID ¶ added in v0.7.0
func (*ContactChannelChangedEvent) Type ¶ added in v0.5.0
func (e *ContactChannelChangedEvent) Type() string
Type returns the type of this event
func (*ContactChannelChangedEvent) Validate ¶ added in v0.6.0
func (e *ContactChannelChangedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type ContactFieldChangedEvent ¶ added in v0.5.0
type ContactFieldChangedEvent struct { Field *flows.FieldReference `json:"field" validate:"required"` Value string `json:"value" validate:"required"` // contains filtered or unexported fields }
ContactFieldChangedEvent events are created when a contact field is updated.
{ "type": "contact_field_changed", "created_on": "2006-01-02T15:04:05Z", "field": {"key": "gender", "name": "Gender"}, "value": "Male" }
@event contact_field_changed
func NewContactFieldChangedEvent ¶ added in v0.5.0
func NewContactFieldChangedEvent(field *flows.FieldReference, value string) *ContactFieldChangedEvent
NewContactFieldChangedEvent returns a new save to contact event
func (*ContactFieldChangedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *ContactFieldChangedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*ContactFieldChangedEvent) Apply ¶ added in v0.5.0
func (e *ContactFieldChangedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*ContactFieldChangedEvent) FromCaller ¶ added in v0.6.2
func (e *ContactFieldChangedEvent) FromCaller() bool
func (*ContactFieldChangedEvent) SetCreatedOn ¶ added in v0.6.2
func (*ContactFieldChangedEvent) SetFromCaller ¶ added in v0.6.2
func (e *ContactFieldChangedEvent) SetFromCaller(fromCaller bool)
func (*ContactFieldChangedEvent) SetStepUUID ¶ added in v0.7.0
func (*ContactFieldChangedEvent) Type ¶ added in v0.5.0
func (e *ContactFieldChangedEvent) Type() string
Type returns the type of this event
func (*ContactFieldChangedEvent) Validate ¶ added in v0.6.0
func (e *ContactFieldChangedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type ContactGroupsAddedEvent ¶ added in v0.5.0
type ContactGroupsAddedEvent struct { Groups []*flows.GroupReference `json:"groups" validate:"required,min=1,dive"` // contains filtered or unexported fields }
ContactGroupsAddedEvent events will be created with the groups a contact was added to.
{ "type": "contact_groups_added", "created_on": "2006-01-02T15:04:05Z", "groups": [{"uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d", "name": "Reporters"}] }
@event contact_groups_added
func NewContactGroupsAddedEvent ¶ added in v0.5.0
func NewContactGroupsAddedEvent(groups []*flows.GroupReference) *ContactGroupsAddedEvent
NewContactGroupsAddedEvent returns a new contact_groups_added event
func (*ContactGroupsAddedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *ContactGroupsAddedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*ContactGroupsAddedEvent) Apply ¶ added in v0.5.0
func (e *ContactGroupsAddedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*ContactGroupsAddedEvent) FromCaller ¶ added in v0.6.2
func (e *ContactGroupsAddedEvent) FromCaller() bool
func (*ContactGroupsAddedEvent) SetCreatedOn ¶ added in v0.6.2
func (*ContactGroupsAddedEvent) SetFromCaller ¶ added in v0.6.2
func (e *ContactGroupsAddedEvent) SetFromCaller(fromCaller bool)
func (*ContactGroupsAddedEvent) SetStepUUID ¶ added in v0.7.0
func (*ContactGroupsAddedEvent) Type ¶ added in v0.5.0
func (e *ContactGroupsAddedEvent) Type() string
Type returns the type of this event
func (*ContactGroupsAddedEvent) Validate ¶ added in v0.6.0
func (e *ContactGroupsAddedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type ContactGroupsRemovedEvent ¶ added in v0.5.0
type ContactGroupsRemovedEvent struct { Groups []*flows.GroupReference `json:"groups" validate:"required,min=1,dive"` // contains filtered or unexported fields }
ContactGroupsRemovedEvent events are created when a contact has been removed from one or more groups.
{ "type": "contact_groups_removed", "created_on": "2006-01-02T15:04:05Z", "groups": [{"uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d", "name": "Reporters"}] }
@event contact_groups_removed
func NewContactGroupsRemovedEvent ¶ added in v0.5.0
func NewContactGroupsRemovedEvent(groups []*flows.GroupReference) *ContactGroupsRemovedEvent
NewContactGroupsRemovedEvent returns a new remove from group event
func (*ContactGroupsRemovedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *ContactGroupsRemovedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*ContactGroupsRemovedEvent) Apply ¶ added in v0.5.0
func (e *ContactGroupsRemovedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*ContactGroupsRemovedEvent) FromCaller ¶ added in v0.6.2
func (e *ContactGroupsRemovedEvent) FromCaller() bool
func (*ContactGroupsRemovedEvent) SetCreatedOn ¶ added in v0.6.2
func (*ContactGroupsRemovedEvent) SetFromCaller ¶ added in v0.6.2
func (e *ContactGroupsRemovedEvent) SetFromCaller(fromCaller bool)
func (*ContactGroupsRemovedEvent) SetStepUUID ¶ added in v0.7.0
func (*ContactGroupsRemovedEvent) Type ¶ added in v0.5.0
func (e *ContactGroupsRemovedEvent) Type() string
Type returns the type of this event
func (*ContactGroupsRemovedEvent) Validate ¶ added in v0.6.0
func (e *ContactGroupsRemovedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type ContactPropertyChangedEvent ¶ added in v0.5.0
type ContactPropertyChangedEvent struct { Property string `json:"property" validate:"required,eq=name|eq=language"` Value string `json:"value"` // contains filtered or unexported fields }
ContactPropertyChangedEvent events are created when a property of a contact has been changed
{ "type": "contact_property_changed", "created_on": "2006-01-02T15:04:05Z", "property": "language", "value": "eng" }
@event contact_property_changed
func NewContactPropertyChangedEvent ¶ added in v0.5.0
func NewContactPropertyChangedEvent(property string, value string) *ContactPropertyChangedEvent
NewContactPropertyChangedEvent returns a new contact property changed event
func (*ContactPropertyChangedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *ContactPropertyChangedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*ContactPropertyChangedEvent) Apply ¶ added in v0.5.0
func (e *ContactPropertyChangedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*ContactPropertyChangedEvent) FromCaller ¶ added in v0.6.2
func (e *ContactPropertyChangedEvent) FromCaller() bool
func (*ContactPropertyChangedEvent) SetCreatedOn ¶ added in v0.6.2
func (*ContactPropertyChangedEvent) SetFromCaller ¶ added in v0.6.2
func (e *ContactPropertyChangedEvent) SetFromCaller(fromCaller bool)
func (*ContactPropertyChangedEvent) SetStepUUID ¶ added in v0.7.0
func (*ContactPropertyChangedEvent) Type ¶ added in v0.5.0
func (e *ContactPropertyChangedEvent) Type() string
Type returns the type of this event
func (*ContactPropertyChangedEvent) Validate ¶ added in v0.6.0
func (e *ContactPropertyChangedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type ContactURNAddedEvent ¶ added in v0.5.0
type ContactURNAddedEvent struct { URN urns.URN `json:"urn" validate:"urn"` // contains filtered or unexported fields }
ContactURNAddedEvent events will be created with the URN that should be added to the current contact.
{ "type": "contact_urn_added", "created_on": "2006-01-02T15:04:05Z", "urn": "tel:+12345678900" }
@event contact_urn_added
func NewURNAddedEvent ¶ added in v0.5.0
func NewURNAddedEvent(urn urns.URN) *ContactURNAddedEvent
NewURNAddedEvent returns a new add URN event
func (*ContactURNAddedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *ContactURNAddedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*ContactURNAddedEvent) Apply ¶ added in v0.5.0
func (e *ContactURNAddedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*ContactURNAddedEvent) FromCaller ¶ added in v0.6.2
func (e *ContactURNAddedEvent) FromCaller() bool
func (*ContactURNAddedEvent) SetCreatedOn ¶ added in v0.6.2
func (*ContactURNAddedEvent) SetFromCaller ¶ added in v0.6.2
func (e *ContactURNAddedEvent) SetFromCaller(fromCaller bool)
func (*ContactURNAddedEvent) SetStepUUID ¶ added in v0.7.0
func (*ContactURNAddedEvent) Type ¶ added in v0.5.0
func (e *ContactURNAddedEvent) Type() string
Type returns the type of this event
func (*ContactURNAddedEvent) Validate ¶ added in v0.6.0
func (e *ContactURNAddedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type EmailCreatedEvent ¶ added in v0.5.0
type EmailCreatedEvent struct { Addresses []string `json:"addresses" validate:"required,min=1"` Subject string `json:"subject" validate:"required"` Body string `json:"body"` // contains filtered or unexported fields }
EmailCreatedEvent events are created for each recipient which should receive an email.
{ "type": "email_created", "created_on": "2006-01-02T15:04:05Z", "addresses": ["foo@bar.com"], "subject": "Your activation token", "body": "Your activation token is AAFFKKEE" }
@event email_created
func NewEmailCreatedEvent ¶ added in v0.5.0
func NewEmailCreatedEvent(addresses []string, subject string, body string) *EmailCreatedEvent
NewEmailCreatedEvent returns a new email event with the passed in subject, body and emails
func (*EmailCreatedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *EmailCreatedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*EmailCreatedEvent) Apply ¶ added in v0.5.0
func (e *EmailCreatedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*EmailCreatedEvent) FromCaller ¶ added in v0.6.2
func (e *EmailCreatedEvent) FromCaller() bool
func (*EmailCreatedEvent) SetCreatedOn ¶ added in v0.6.2
func (*EmailCreatedEvent) SetFromCaller ¶ added in v0.6.2
func (e *EmailCreatedEvent) SetFromCaller(fromCaller bool)
func (*EmailCreatedEvent) SetStepUUID ¶ added in v0.7.0
func (*EmailCreatedEvent) Type ¶ added in v0.5.0
func (e *EmailCreatedEvent) Type() string
Type returns the type of this event
func (*EmailCreatedEvent) Validate ¶ added in v0.6.0
func (e *EmailCreatedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type EnvironmentChangedEvent ¶ added in v0.5.0
type EnvironmentChangedEvent struct { Environment json.RawMessage `json:"environment"` // contains filtered or unexported fields }
EnvironmentChangedEvent events are created to set the environment on a session
{ "type": "environment_changed", "created_on": "2006-01-02T15:04:05Z", "environment": { "date_format": "YYYY-MM-DD", "time_format": "hh:mm", "timezone": "Africa/Kigali", "languages": ["eng", "fra"] } }
@event environment_changed
func (*EnvironmentChangedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *EnvironmentChangedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*EnvironmentChangedEvent) Apply ¶ added in v0.5.0
func (e *EnvironmentChangedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*EnvironmentChangedEvent) FromCaller ¶ added in v0.6.2
func (e *EnvironmentChangedEvent) FromCaller() bool
func (*EnvironmentChangedEvent) SetCreatedOn ¶ added in v0.6.2
func (*EnvironmentChangedEvent) SetFromCaller ¶ added in v0.6.2
func (e *EnvironmentChangedEvent) SetFromCaller(fromCaller bool)
func (*EnvironmentChangedEvent) SetStepUUID ¶ added in v0.7.0
func (*EnvironmentChangedEvent) Type ¶ added in v0.5.0
func (e *EnvironmentChangedEvent) Type() string
Type returns the type of this event
func (*EnvironmentChangedEvent) Validate ¶ added in v0.6.0
func (e *EnvironmentChangedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type ErrorEvent ¶
type ErrorEvent struct { Text string `json:"text" validate:"required"` Fatal bool `json:"fatal"` // contains filtered or unexported fields }
ErrorEvent events will be created whenever an error is encountered during flow execution. This can vary from template evaluation errors to invalid actions.
{ "type": "error", "created_on": "2006-01-02T15:04:05Z", "text": "invalid date format: '12th of October'" }
@event error
func NewErrorEvent ¶
func NewErrorEvent(err error) *ErrorEvent
NewErrorEvent returns a new error event for the passed in error
func NewFatalErrorEvent ¶ added in v0.4.0
func NewFatalErrorEvent(err error) *ErrorEvent
NewFatalErrorEvent returns a new fatal error event for the passed in error
func (*ErrorEvent) AllowedOrigin ¶ added in v0.6.0
func (e *ErrorEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*ErrorEvent) Apply ¶ added in v0.4.0
func (e *ErrorEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*ErrorEvent) FromCaller ¶ added in v0.6.2
func (e *ErrorEvent) FromCaller() bool
func (*ErrorEvent) SetCreatedOn ¶ added in v0.6.2
func (*ErrorEvent) SetFromCaller ¶ added in v0.6.2
func (e *ErrorEvent) SetFromCaller(fromCaller bool)
func (*ErrorEvent) SetStepUUID ¶ added in v0.7.0
func (*ErrorEvent) Validate ¶ added in v0.6.0
func (e *ErrorEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type FlowTriggeredEvent ¶ added in v0.4.0
type FlowTriggeredEvent struct { Flow *flows.FlowReference `json:"flow" validate:"required"` ParentRunUUID flows.RunUUID `json:"parent_run_uuid" validate:"omitempty,uuid4"` // contains filtered or unexported fields }
FlowTriggeredEvent events are created when an action wants to start a subflow
{ "type": "flow_triggered", "created_on": "2006-01-02T15:04:05Z", "flow": {"uuid": "0e06f977-cbb7-475f-9d0b-a0c4aaec7f6a", "name": "Registration"}, "parent_run_uuid": "95eb96df-461b-4668-b168-727f8ceb13dd" }
@event flow_triggered
func NewFlowTriggeredEvent ¶ added in v0.4.0
func NewFlowTriggeredEvent(flow *flows.FlowReference, parentRunUUID flows.RunUUID) *FlowTriggeredEvent
NewFlowTriggeredEvent returns a new flow triggered event for the passed in flow and parent run
func (*FlowTriggeredEvent) AllowedOrigin ¶ added in v0.6.0
func (e *FlowTriggeredEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*FlowTriggeredEvent) Apply ¶ added in v0.4.0
func (e *FlowTriggeredEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*FlowTriggeredEvent) FromCaller ¶ added in v0.6.2
func (e *FlowTriggeredEvent) FromCaller() bool
func (*FlowTriggeredEvent) SetCreatedOn ¶ added in v0.6.2
func (*FlowTriggeredEvent) SetFromCaller ¶ added in v0.6.2
func (e *FlowTriggeredEvent) SetFromCaller(fromCaller bool)
func (*FlowTriggeredEvent) SetStepUUID ¶ added in v0.7.0
func (*FlowTriggeredEvent) Type ¶ added in v0.4.0
func (e *FlowTriggeredEvent) Type() string
Type returns the type of this event
func (*FlowTriggeredEvent) Validate ¶ added in v0.6.0
func (e *FlowTriggeredEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs. We assume engine generated events are valid.
type InputLabelsAddedEvent ¶ added in v0.5.0
type InputLabelsAddedEvent struct { InputUUID flows.InputUUID `json:"input_uuid" validate:"required,uuid4"` Labels []*flows.LabelReference `json:"labels" validate:"required,min=1,dive"` // contains filtered or unexported fields }
InputLabelsAddedEvent events will be created with the labels that were applied to the given input.
{ "type": "input_labels_added", "created_on": "2006-01-02T15:04:05Z", "input_uuid": "4aef4050-1895-4c80-999a-70368317a4f5", "labels": [{"uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d", "name": "Spam"}] }
@event input_labels_added
func NewInputLabelsAddedEvent ¶ added in v0.5.0
func NewInputLabelsAddedEvent(inputUUID flows.InputUUID, labels []*flows.LabelReference) *InputLabelsAddedEvent
NewInputLabelsAddedEvent returns a new add to group event
func (*InputLabelsAddedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *InputLabelsAddedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*InputLabelsAddedEvent) Apply ¶ added in v0.5.0
func (e *InputLabelsAddedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*InputLabelsAddedEvent) FromCaller ¶ added in v0.6.2
func (e *InputLabelsAddedEvent) FromCaller() bool
func (*InputLabelsAddedEvent) SetCreatedOn ¶ added in v0.6.2
func (*InputLabelsAddedEvent) SetFromCaller ¶ added in v0.6.2
func (e *InputLabelsAddedEvent) SetFromCaller(fromCaller bool)
func (*InputLabelsAddedEvent) SetStepUUID ¶ added in v0.7.0
func (*InputLabelsAddedEvent) Type ¶ added in v0.5.0
func (e *InputLabelsAddedEvent) Type() string
Type returns the type of this event
func (*InputLabelsAddedEvent) Validate ¶ added in v0.6.0
func (e *InputLabelsAddedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type MsgCreatedEvent ¶ added in v0.6.0
type MsgCreatedEvent struct { Msg flows.MsgOut `json:"msg" validate:"required,dive"` // contains filtered or unexported fields }
MsgCreatedEvent events are used for replies to the session contact.
{ "type": "msg_created", "created_on": "2006-01-02T15:04:05Z", "msg": { "uuid": "2d611e17-fb22-457f-b802-b8f7ec5cda5b", "channel": {"uuid": "61602f3e-f603-4c70-8a8f-c477505bf4bf", "name": "Twilio"}, "urn": "tel:+12065551212", "text": "hi there", "attachments": ["https://s3.amazon.com/mybucket/attachment.jpg"] } }
@event msg_created
func NewMsgCreatedEvent ¶ added in v0.5.0
func NewMsgCreatedEvent(msg *flows.MsgOut) *MsgCreatedEvent
NewMsgCreatedEvent creates a new outgoing msg event to a single contact
func (*MsgCreatedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *MsgCreatedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*MsgCreatedEvent) Apply ¶ added in v0.6.0
func (e *MsgCreatedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*MsgCreatedEvent) FromCaller ¶ added in v0.6.2
func (e *MsgCreatedEvent) FromCaller() bool
func (*MsgCreatedEvent) SetCreatedOn ¶ added in v0.6.2
func (*MsgCreatedEvent) SetFromCaller ¶ added in v0.6.2
func (e *MsgCreatedEvent) SetFromCaller(fromCaller bool)
func (*MsgCreatedEvent) SetStepUUID ¶ added in v0.7.0
func (*MsgCreatedEvent) Type ¶ added in v0.6.0
func (e *MsgCreatedEvent) Type() string
Type returns the type of this event
func (*MsgCreatedEvent) Validate ¶ added in v0.6.0
func (e *MsgCreatedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs. We assume engine generated events are valid.
type MsgReceivedEvent ¶
type MsgReceivedEvent struct { Msg flows.MsgIn `json:"msg" validate:"required,dive"` // contains filtered or unexported fields }
MsgReceivedEvent events are used for starting flows or resuming flows which are waiting for a message. They represent an incoming message for a contact.
{ "type": "msg_received", "created_on": "2006-01-02T15:04:05Z", "msg": { "uuid": "2d611e17-fb22-457f-b802-b8f7ec5cda5b", "channel": {"uuid": "61602f3e-f603-4c70-8a8f-c477505bf4bf", "name": "Twilio"}, "urn": "tel:+12065551212", "text": "hi there", "attachments": ["https://s3.amazon.com/mybucket/attachment.jpg"] } }
@event msg_received
func NewMsgReceivedEvent ¶
func NewMsgReceivedEvent(msg *flows.MsgIn) *MsgReceivedEvent
NewMsgReceivedEvent creates a new incoming msg event for the passed in channel, URN and text
func (*MsgReceivedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *MsgReceivedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*MsgReceivedEvent) Apply ¶ added in v0.4.0
func (e *MsgReceivedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*MsgReceivedEvent) FromCaller ¶ added in v0.6.2
func (e *MsgReceivedEvent) FromCaller() bool
func (*MsgReceivedEvent) SetCreatedOn ¶ added in v0.6.2
func (*MsgReceivedEvent) SetFromCaller ¶ added in v0.6.2
func (e *MsgReceivedEvent) SetFromCaller(fromCaller bool)
func (*MsgReceivedEvent) SetStepUUID ¶ added in v0.7.0
func (*MsgReceivedEvent) Type ¶
func (e *MsgReceivedEvent) Type() string
Type returns the type of this event
func (*MsgReceivedEvent) Validate ¶ added in v0.6.0
func (e *MsgReceivedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type MsgWaitEvent ¶
type MsgWaitEvent struct { TimeoutOn *time.Time `json:"timeout_on,omitempty"` // contains filtered or unexported fields }
MsgWaitEvent events are created when a flow pauses waiting for a response from a contact. If a timeout is set, then the caller should resume the flow after the number of seconds in the timeout to resume it.
{ "type": "msg_wait", "created_on": "2006-01-02T15:04:05Z", "timeout": 300 }
@event msg_wait
func NewMsgWait ¶
func NewMsgWait(timeoutOn *time.Time) *MsgWaitEvent
NewMsgWait returns a new msg wait with the passed in timeout
func (*MsgWaitEvent) AllowedOrigin ¶ added in v0.6.0
func (e *MsgWaitEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*MsgWaitEvent) Apply ¶ added in v0.4.0
func (e *MsgWaitEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*MsgWaitEvent) FromCaller ¶ added in v0.6.2
func (e *MsgWaitEvent) FromCaller() bool
func (*MsgWaitEvent) SetCreatedOn ¶ added in v0.6.2
func (*MsgWaitEvent) SetFromCaller ¶ added in v0.6.2
func (e *MsgWaitEvent) SetFromCaller(fromCaller bool)
func (*MsgWaitEvent) SetStepUUID ¶ added in v0.7.0
func (*MsgWaitEvent) Type ¶
func (e *MsgWaitEvent) Type() string
Type returns the type of this event
func (*MsgWaitEvent) Validate ¶ added in v0.6.0
func (e *MsgWaitEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs. We assume engine generated events are valid.
type NothingWaitEvent ¶ added in v0.4.0
type NothingWaitEvent struct {
// contains filtered or unexported fields
}
NothingWaitEvent events are created when a flow requests to hand back control to the caller but isn't waiting for anything from the caller.
{ "type": "nothing_wait", "created_on": "2006-01-02T15:04:05.234532Z" }
@event nothing_wait
func NewNothingWait ¶ added in v0.4.0
func NewNothingWait() *NothingWaitEvent
NewNothingWait returns a new nothing wait
func (*NothingWaitEvent) AllowedOrigin ¶ added in v0.6.0
func (e *NothingWaitEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*NothingWaitEvent) Apply ¶ added in v0.4.0
func (e *NothingWaitEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*NothingWaitEvent) FromCaller ¶ added in v0.6.2
func (e *NothingWaitEvent) FromCaller() bool
func (*NothingWaitEvent) SetCreatedOn ¶ added in v0.6.2
func (*NothingWaitEvent) SetFromCaller ¶ added in v0.6.2
func (e *NothingWaitEvent) SetFromCaller(fromCaller bool)
func (*NothingWaitEvent) SetStepUUID ¶ added in v0.7.0
func (*NothingWaitEvent) Type ¶ added in v0.4.0
func (e *NothingWaitEvent) Type() string
Type returns the type of this event
func (*NothingWaitEvent) Validate ¶ added in v0.6.0
func (e *NothingWaitEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs. We assume engine generated events are valid.
type RunExpiredEvent ¶ added in v0.4.0
type RunExpiredEvent struct { RunUUID flows.RunUUID `json:"run_uuid" validate:"required,uuid4"` // contains filtered or unexported fields }
RunExpiredEvent events are sent by the caller to notify the engine that a run has expired
{ "type": "run_expired", "created_on": "2006-01-02T15:04:05Z", "run_uuid": "0e06f977-cbb7-475f-9d0b-a0c4aaec7f6a" }
@event run_expired
func (*RunExpiredEvent) AllowedOrigin ¶ added in v0.6.0
func (e *RunExpiredEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*RunExpiredEvent) Apply ¶ added in v0.4.0
func (e *RunExpiredEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*RunExpiredEvent) FromCaller ¶ added in v0.6.2
func (e *RunExpiredEvent) FromCaller() bool
func (*RunExpiredEvent) SetCreatedOn ¶ added in v0.6.2
func (*RunExpiredEvent) SetFromCaller ¶ added in v0.6.2
func (e *RunExpiredEvent) SetFromCaller(fromCaller bool)
func (*RunExpiredEvent) SetStepUUID ¶ added in v0.7.0
func (*RunExpiredEvent) Type ¶ added in v0.4.0
func (e *RunExpiredEvent) Type() string
Type returns the type of this event
func (*RunExpiredEvent) Validate ¶ added in v0.6.0
func (e *RunExpiredEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type RunResultChangedEvent ¶ added in v0.5.0
type RunResultChangedEvent struct { Name string `json:"name" validate:"required"` Value string `json:"value"` Category string `json:"category"` CategoryLocalized string `json:"category_localized,omitempty"` NodeUUID flows.NodeUUID `json:"node_uuid" validate:"required,uuid4"` Operand string `json:"operand,omitempty"` // contains filtered or unexported fields }
RunResultChangedEvent events are created when a result is saved. They contain not only the name, value and category of the result, but also the UUID of the node where the result was generated.
{ "type": "run_result_changed", "created_on": "2006-01-02T15:04:05Z", "name": "Gender", "value": "m", "category": "Male", "category_localized": "Homme", "node_uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d", "input": "M" }
@event run_result_changed
func NewRunResultChangedEvent ¶ added in v0.5.0
func NewRunResultChangedEvent(name string, value string, categoryName string, categoryLocalized string, node flows.NodeUUID, operand string) *RunResultChangedEvent
NewRunResultChangedEvent returns a new save result event for the passed in values
func (*RunResultChangedEvent) AllowedOrigin ¶ added in v0.6.0
func (e *RunResultChangedEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*RunResultChangedEvent) Apply ¶ added in v0.5.0
func (e *RunResultChangedEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*RunResultChangedEvent) FromCaller ¶ added in v0.6.2
func (e *RunResultChangedEvent) FromCaller() bool
func (*RunResultChangedEvent) SetCreatedOn ¶ added in v0.6.2
func (*RunResultChangedEvent) SetFromCaller ¶ added in v0.6.2
func (e *RunResultChangedEvent) SetFromCaller(fromCaller bool)
func (*RunResultChangedEvent) SetStepUUID ¶ added in v0.7.0
func (*RunResultChangedEvent) Type ¶ added in v0.5.0
func (e *RunResultChangedEvent) Type() string
Type returns the type of this event
func (*RunResultChangedEvent) Validate ¶ added in v0.6.0
func (e *RunResultChangedEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs
type SessionTriggeredEvent ¶ added in v0.4.0
type SessionTriggeredEvent struct { Flow *flows.FlowReference `json:"flow" validate:"required"` URNs []urns.URN `json:"urns,omitempty" validate:"dive,urn"` Contacts []*flows.ContactReference `json:"contacts,omitempty" validate:"dive"` Groups []*flows.GroupReference `json:"groups,omitempty" validate:"dive"` CreateContact bool `json:"create_contact,omitempty"` Run json.RawMessage `json:"run"` // contains filtered or unexported fields }
SessionTriggeredEvent events are created when an action wants to start a subflow
{ "type": "session_triggered", "created_on": "2006-01-02T15:04:05Z", "flow": {"uuid": "0e06f977-cbb7-475f-9d0b-a0c4aaec7f6a", "name": "Registration"}, "groups": [ {"uuid": "8f8e2cae-3c8d-4dce-9c4b-19514437e427", "name": "New contacts"} ], "run": { "uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d", "flow": {"uuid": "93c554a1-b90d-4892-b029-a2a87dec9b87", "name": "Other Flow"}, "contact": { "uuid": "c59b0033-e748-4240-9d4c-e85eb6800151", "name": "Bob", "fields": {"state": {"value": "Azuay", "created_on": "2000-01-01T00:00:00.000000000-00:00"}} }, "results": { "age": { "result_name": "Age", "value": "33", "node": "cd2be8c4-59bc-453c-8777-dec9a80043b8", "created_on": "2000-01-01T00:00:00.000000000-00:00" } } } }
@event session_triggered
func NewSessionTriggeredEvent ¶ added in v0.4.0
func NewSessionTriggeredEvent(flow *flows.FlowReference, urns []urns.URN, contacts []*flows.ContactReference, groups []*flows.GroupReference, createContact bool, runSnapshot json.RawMessage) *SessionTriggeredEvent
NewSessionTriggeredEvent returns a new session triggered event
func (*SessionTriggeredEvent) AllowedOrigin ¶ added in v0.6.0
func (e *SessionTriggeredEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*SessionTriggeredEvent) Apply ¶ added in v0.4.0
func (e *SessionTriggeredEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*SessionTriggeredEvent) FromCaller ¶ added in v0.6.2
func (e *SessionTriggeredEvent) FromCaller() bool
func (*SessionTriggeredEvent) SetCreatedOn ¶ added in v0.6.2
func (*SessionTriggeredEvent) SetFromCaller ¶ added in v0.6.2
func (e *SessionTriggeredEvent) SetFromCaller(fromCaller bool)
func (*SessionTriggeredEvent) SetStepUUID ¶ added in v0.7.0
func (*SessionTriggeredEvent) Type ¶ added in v0.4.0
func (e *SessionTriggeredEvent) Type() string
Type returns the type of this event
func (*SessionTriggeredEvent) Validate ¶ added in v0.6.0
func (e *SessionTriggeredEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs. We assume engine generated events are valid.
type WebhookCalledEvent ¶
type WebhookCalledEvent struct { URL string `json:"url" validate:"required"` Status flows.WebhookStatus `json:"status" validate:"required"` StatusCode int `json:"status_code"` Request string `json:"request" validate:"required"` Response string `json:"response"` // contains filtered or unexported fields }
WebhookCalledEvent events are created when a webhook is called. The event contains the status and status code of the response, as well as a full dump of the request and response.
{ "type": "webhook_called", "created_on": "2006-01-02T15:04:05Z", "url": "https://api.ipify.org?format=json", "status": "success", "status_code": 200, "request": "GET https://api.ipify.org?format=json", "response": "HTTP/1.1 200 OK {\"ip\":\"190.154.48.130\"}" }
@event webhook_called
func NewWebhookCalledEvent ¶ added in v0.4.0
func NewWebhookCalledEvent(url string, status flows.WebhookStatus, statusCode int, request string, response string) *WebhookCalledEvent
NewWebhookCalledEvent returns a new webhook called event
func (*WebhookCalledEvent) AllowedOrigin ¶ added in v0.6.0
func (e *WebhookCalledEvent) AllowedOrigin() flows.EventOrigin
AllowedOrigin determines where this event type can originate
func (*WebhookCalledEvent) Apply ¶ added in v0.4.0
func (e *WebhookCalledEvent) Apply(run flows.FlowRun) error
Apply applies this event to the given run
func (*WebhookCalledEvent) FromCaller ¶ added in v0.6.2
func (e *WebhookCalledEvent) FromCaller() bool
func (*WebhookCalledEvent) SetCreatedOn ¶ added in v0.6.2
func (*WebhookCalledEvent) SetFromCaller ¶ added in v0.6.2
func (e *WebhookCalledEvent) SetFromCaller(fromCaller bool)
func (*WebhookCalledEvent) SetStepUUID ¶ added in v0.7.0
func (*WebhookCalledEvent) Type ¶
func (e *WebhookCalledEvent) Type() string
Type returns the type of this event
func (*WebhookCalledEvent) Validate ¶ added in v0.6.0
func (e *WebhookCalledEvent) Validate(assets flows.SessionAssets) error
Validate validates our event is valid and has all the assets it needs. We assume engine generated events are valid.
Source Files ¶
- base.go
- broadcast_created.go
- contact_changed.go
- contact_channel_changed.go
- contact_field_changed.go
- contact_groups_added.go
- contact_groups_removed.go
- contact_property_changed.go
- contact_urn_added.go
- email_created.go
- envelope.go
- environment_changed.go
- error.go
- flow_triggered.go
- input_labels_added.go
- msg_created.go
- msg_received.go
- msg_wait.go
- nothing_wait.go
- run_expired.go
- run_result_changed.go
- session_triggered.go
- webhook_called.go