api_server_events

package
v0.1.3-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiServerEventInterface

type ApiServerEventInterface interface {
	ToJson() []byte
}

type ApiServerEventType

type ApiServerEventType string
const (
	ApiServerNewNotificationEvent    ApiServerEventType = "NewNotification"
	ApiServerNewMessageEvent         ApiServerEventType = "NewMessage"
	ApiServerChatAssignmentEvent     ApiServerEventType = "ChatAssignment"
	ApiServerChatUnAssignmentEvent   ApiServerEventType = "ChatUnAssignment"
	ApiServerErrorEvent              ApiServerEventType = "Error"
	ApiServerReloadRequiredEvent     ApiServerEventType = "ReloadRequired"
	ApiServerConversationClosedEvent ApiServerEventType = "ConversationClosed"
	ApiServerNewConversationEvent    ApiServerEventType = "NewConversation"
)

type BaseApiServerEvent

type BaseApiServerEvent struct {
	EventType    ApiServerEventType         `json:"eventType"`
	Conversation ConversationWithAllDetails `json:"conversation"`
}

func (*BaseApiServerEvent) ToJson

func (event *BaseApiServerEvent) ToJson() []byte

type ChatAssignmentEvent

type ChatAssignmentEvent struct {
	BaseApiServerEvent
	EventType ApiServerEventType `json:"eventType"`
	ChatId    string             `json:"chatId"`
	UserId    string             `json:"userId"`
}

type ChatUnAssignmentEvent

type ChatUnAssignmentEvent struct {
	BaseApiServerEvent
	EventType ApiServerEventType `json:"eventType"`
	ChatId    string             `json:"chatId"`
	UserId    string             `json:"userId"`
}

type ConversationWithAllDetails

type ConversationWithAllDetails struct {
	model.Conversation
	Contact    model.Contact `json:"contact"`
	AssignedTo struct {
		model.OrganizationMember
		User model.User `json:"user"`
	} `json:"assignedTo"`
	WhatsappBusinessAccount struct {
		model.WhatsappBusinessAccount
		Organization model.Organization `json:"organization"`
	} `json:"whatsappBusinessAccount"`
}

type NewMessageEvent

type NewMessageEvent struct {
	BaseApiServerEvent
	EventType ApiServerEventType      `json:"eventType"`
	Message   api_types.MessageSchema `json:"message"`
}

func (*NewMessageEvent) ToJson

func (event *NewMessageEvent) ToJson() []byte

type NewNotificationEvent

type NewNotificationEvent struct {
	BaseApiServerEvent                    // make it inline
	EventType          ApiServerEventType `json:"eventType"`
	Notification       string             `json:"notification"`
}

Jump to

Keyboard shortcuts

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