types

package
v0.0.0-...-2c63f42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeCompletedOrder  = "trigger:completed_order"
	NodeReceivedMessage = "trigger:received_message"
	NodeReceivedReply   = "trigger:received_reply"
	NodeSendMessage     = "action:send_message"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletedOrderNodeData

type CompletedOrderNodeData struct {
	Type   NodeType  `json:"type"`
	NextID dot.IntID `json:"next_id,omitempty"`
	Fields []string  `json:"fields"`
}

func (*CompletedOrderNodeData) Next

func (n *CompletedOrderNodeData) Next(typ NodeType, data map[string]string) dot.IntID

type CreateFlowRequest

type CreateFlowRequest struct {
	Flow *Flow `json:"flow"`
}

type CreateFlowResponse

type CreateFlowResponse struct {
	Flow *Flow `json:"flow"`
}

type Flow

type Flow struct {
	ID      dot.IntID   `json:"id"`
	PageIDs []dot.IntID `json:"page_ids"`
	Nodes   []*Node     `json:"nodes"`
}

func (*Flow) NodeByID

func (f *Flow) NodeByID(nodeID dot.IntID) *Node

type FlowResponse

type FlowResponse struct {
	Flow *Flow `json:"flow"`
}

type GetFlowByIDRequest

type GetFlowByIDRequest struct {
	ID dot.IntID `json:"id"`
}

type GetFlowByParamRequest

type GetFlowByParamRequest struct {
	FBPageID dot.IntID `json:"id"`
}

type Node

type Node struct {
	ID      dot.IntID    `json:"id,omitempty"`
	Payload *NodePayload `json:"payload,omitempty"`
}

func (*Node) String

func (n *Node) String() string

type NodeNextInterface

type NodeNextInterface interface {
	Next(typ NodeType, data map[string]string) dot.IntID
}

type NodePayload

type NodePayload struct {
	// Type            NodeType `json:"type"`
	CompletedOrder  *CompletedOrderNodeData
	SendMessage     *SendMessageNodeData
	ReceivedMessage *ReceivedMessageNodeData
}

func (*NodePayload) MarshalJSON

func (n *NodePayload) MarshalJSON() ([]byte, error)

func (*NodePayload) Next

func (n *NodePayload) Next(typ NodeType, data map[string]string) dot.IntID

func (*NodePayload) Type

func (n *NodePayload) Type() NodeType

func (*NodePayload) UnmarshalJSON

func (n *NodePayload) UnmarshalJSON(data []byte) error

type NodeType

type NodeType string

type QuickReplyItem

type QuickReplyItem struct {
	Text   string    `json:"text"`
	Code   string    `json:"code"`
	NextID dot.IntID `json:"next_id"`
}

type ReceivedMessageNodeData

type ReceivedMessageNodeData struct {
	Type   NodeType  `json:"type"`
	NextID dot.IntID `json:"next_id"`
}

func (*ReceivedMessageNodeData) Next

func (n *ReceivedMessageNodeData) Next(typ NodeType, data map[string]string) dot.IntID

type SendMessageNodeData

type SendMessageNodeData struct {
	Type         NodeType          `json:"type"`
	Template     string            `json:"template"`
	NextID       dot.IntID         `json:"next_id,omitempty"`
	QuickReplies []*QuickReplyItem `json:"quick_replies"`
}

func (*SendMessageNodeData) Next

func (n *SendMessageNodeData) Next(typ NodeType, data map[string]string) dot.IntID

type UpdateFlowRequest

type UpdateFlowRequest struct {
	Flow *Flow `json:"flow"`
}

type UpdateFlowResponse

type UpdateFlowResponse struct {
	Flow *Flow `json:"flow"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL