digisac

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MESSAGE_TYPE_TICKET   = "ticket"
	MESSAGE_TYPE_CHAT     = "chat"
	MESSAGE_ORIGIN_TICKET = "ticket"
	EVENT_NEW_MESSAGE     = "message.created"
)
View Source
const (
	TOKEN_VALIDITY_MINUTES = 60 * 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	Unsubscribed         bool        `json:"unsubscribed,omitempty"`
	ID                   string      `json:"id,omitempty"`
	IsMe                 bool        `json:"isMe,omitempty"`
	IsGroup              bool        `json:"isGroup,omitempty"`
	IsBroadcast          bool        `json:"isBroadcast,omitempty"`
	Unread               int         `json:"unread,omitempty"`
	IsSilenced           bool        `json:"isSilenced,omitempty"`
	IsMyContact          bool        `json:"isMyContact,omitempty"`
	HadChat              bool        `json:"hadChat,omitempty"`
	Visible              bool        `json:"visible,omitempty"`
	Note                 string      `json:"note,omitempty"`
	LastMessageAt        time.Time   `json:"lastMessageAt,omitempty"`
	LastMessageID        string      `json:"lastMessageId,omitempty"`
	AccountID            string      `json:"accountId,omitempty"`
	ServiceID            string      `json:"serviceId,omitempty"`
	PersonID             string      `json:"personId,omitempty"`
	DefaultDepartmentID  string      `json:"defaultDepartmentId,omitempty"`
	DefaultUserID        time.Time   `json:"defaultUserId,omitempty"`
	CreatedAt            time.Time   `json:"createdAt,omitempty"`
	UpdatedAt            time.Time   `json:"updatedAt,omitempty"`
	DeletedAt            time.Time   `json:"deletedAt,omitempty"`
	Status               string      `json:"status,omitempty"`
	LastContactMessageAt time.Time   `json:"lastContactMessageAt,omitempty"`
	Name                 string      `json:"name,omitempty"`
	InternalName         string      `json:"internalName,omitempty"`
	AlternativeName      string      `json:"alternativeName,omitempty"`
	Data                 ContactData `json:"data,omitempty"`
	LastMessage          time.Time   `json:"lastMessage,omitempty"`
}

func (*Contact) ContactID added in v0.7.1

func (c *Contact) ContactID() string

func (*Contact) Phonenumber added in v0.7.1

func (c *Contact) Phonenumber() string

type ContactData

type ContactData struct {
	Valid              bool      `json:"valid,omitempty"`
	Number             string    `json:"number,omitempty"`
	Unread             bool      `json:"unread,omitempty"`
	Webchat            Webchat   `json:"webchat,omitempty"`
	IsOriginal         bool      `json:"isOriginal,omitempty"`
	BotIsRunning       bool      `json:"botIsRunning,omitempty"`
	LastChargedMessage time.Time `json:"lastChargedMessage,omitempty"`
}

type Digisac

type Digisac struct {
	// contains filtered or unexported fields
}

func NewDigisac

func NewDigisac(rest *rest.Rest) *Digisac

func (*Digisac) Autenticate

func (d *Digisac) Autenticate() error

func (*Digisac) GetContactByID

func (d *Digisac) GetContactByID(id string) (*Contact, error)

type InternalData

type InternalData struct {
	// Ack            int  `json:"ack,omitempty"`
	IsNew          bool `json:"isNew,omitempty"`
	IsFirst        bool `json:"isFirst,omitempty"`
	TicketTransfer bool `json:"ticketTransfer,omitempty"`
	DontOpenTicket bool `json:"dontOpenTicket,omitempty"`
	TicketClose    bool `json:"ticketClose,omitempty"`
}

type Parser

type Parser struct {
}

func NewParser

func NewParser() *Parser

func (*Parser) GetContact

func (d *Parser) GetContact(raw string) (*Contact, error)

type WebHookMessage

type WebHookMessage struct {
	Event     string      `json:"event,omitempty"`
	Data      WebhookData `json:"data,omitempty"`
	WebhookID string      `json:"webhookId,omitempty"`
	Timestamp time.Time   `json:"timestamp,omitempty"`
}

func (*WebHookMessage) ContactID added in v0.7.1

func (w *WebHookMessage) ContactID() string

func (*WebHookMessage) IsFromContact added in v0.7.1

func (w *WebHookMessage) IsFromContact() bool

func (*WebHookMessage) IsNewMessage added in v0.7.1

func (w *WebHookMessage) IsNewMessage() bool

func (*WebHookMessage) Text added in v0.7.2

func (w *WebHookMessage) Text() string

type Webchat

type Webchat struct {
}

type WebhookData

type WebhookData struct {
	ID                 string                 `json:"id,omitempty"`
	IsFromMe           bool                   `json:"isFromMe,omitempty"`
	Sent               bool                   `json:"sent,omitempty"`
	Type               string                 `json:"type,omitempty"`
	Timestamp          time.Time              `json:"timestamp,omitempty"`
	Data               InternalData           `json:"data,omitempty"`
	Visible            bool                   `json:"visible,omitempty"`
	AccountID          string                 `json:"accountId,omitempty"`
	ContactID          string                 `json:"contactId,omitempty"`
	FromID             string                 `json:"fromId,omitempty"`
	ServiceID          string                 `json:"serviceId,omitempty"`
	ToID               string                 `json:"toId,omitempty"`
	UserID             string                 `json:"userId,omitempty"`
	TicketID           string                 `json:"ticketId,omitempty"`
	TicketUserID       string                 `json:"ticketUserId,omitempty"`
	TicketDepartmentID string                 `json:"ticketDepartmentId,omitempty"`
	QuotedMessageID    string                 `json:"quotedMessageId,omitempty"`
	Origin             string                 `json:"origin,omitempty"`
	HsmID              string                 `json:"hsmId,omitempty"`
	Text               string                 `json:"text,omitempty"`
	Obfuscated         bool                   `json:"obfuscated,omitempty"`
	Files              map[string]interface{} `json:"files,omitempty"`
	QuotedMessage      string                 `json:"quotedMessage,omitempty"`
	IsFromBot          bool                   `json:"isFromBot,omitempty"`
}

Jump to

Keyboard shortcuts

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