api

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MuteActionMute   MuteAction = 1
	MuteActionUnmute MuteAction = 3

	MuteDuration1Hour    int = 3600
	MuteDuration4Hour    int = 14400
	MuteDurationForever  int = -1
	MuteDurationUntil8AM int = 0
)

Variables

View Source
var (
	ErrSenderRecall = errs.NewZCA(
		"to delete a message you sent from others' view, call UndoMessage instead",
		"api.DeleteMessage",
	)
	ErrDMRecipientsDeleteUnsupported = errs.NewZCA(
		"delete for everyone is not supported in direct messages",
		"api.DeleteMessage",
	)
)
View Source
var (
	ErrMessageEmpty  = errs.NewZCA("message content cannot be empty", "api.ForwardMessage")
	ErrThreadIDEmpty = errs.NewZCA("threadID cannot be empty", "api.ForwardMessage")
)
View Source
var (
	ErrMessageContentEmpty        = errs.NewZCA("message content cannot be empty", "api.SendMessage")
	ErrInvalidMention             = errs.NewZCA("Invalid mentions: total mention characters exceed message length", "api.SendMessage")
	ErrInvalidWebchatQuote        = errs.NewZCA("invalid quote: content must be string for msgType 'webchat'", "api.SendMessage")
	ErrUnsupportedQuotedGroupPoll = errs.NewZCA("quoted message type 'group.poll' is not supported", "api.SendMessage")
)
View Source
var ErrInvalidPIN = errs.NewZCA("invalid pin format", "api.UpdateHiddenChatPIN")
View Source
var ErrInvalidReaction = errs.NewZCA("invalid reaction data", "api.AddReaction")
View Source
var ErrPhoneNumberEmpty = errs.NewZCA("phone number cannot be empty", "api.FindUser")

Functions

func New

func New(sc session.MutableContext) (*api, error)

Types

type AcceptFriendRequestFn

type AcceptFriendRequestFn = func(ctx context.Context, friendID string) (AcceptFriendRequestResponse, error)

type AcceptFriendRequestResponse

type AcceptFriendRequestResponse = string

type AddGroupBlockedMemberFn

type AddGroupBlockedMemberFn = func(ctx context.Context, groupID string, memberID ...string) (AddGroupBlockedMemberResponse, error)

type AddGroupBlockedMemberResponse

type AddGroupBlockedMemberResponse = string

type AddGroupDeputyFn

type AddGroupDeputyFn = func(ctx context.Context, groupID string, memberID ...string) (AddGroupDeputyResponse, error)

type AddGroupDeputyResponse

type AddGroupDeputyResponse = string

type AddPollOptionsFn

type AddPollOptionsFn = func(ctx context.Context, options AddPollOptionsRequest) (*AddPollOptionsResponse, error)

type AddPollOptionsOption

type AddPollOptionsOption struct {
	Voted   bool   `json:"voted"`
	Content string `json:"content"`
}

type AddPollOptionsRequest

type AddPollOptionsRequest struct {
	PollId         int
	Options        []AddPollOptionsOption
	VotedOptionIds []int
}

type AddPollOptionsResponse

type AddPollOptionsResponse struct {
	Options []model.PollOption
}

type AddQuickMessageFn

type AddQuickMessageFn = func(ctx context.Context, message AddQuickMessageRequest) (*AddQuickMessageResponse, error)

type AddQuickMessageRequest

type AddQuickMessageRequest struct {
	Keyword string
	Title   string
	Media   *model.AttachmentSource
}

type AddQuickMessageResponse

type AddQuickMessageResponse struct {
	Item    model.QuickMessage `json:"item"`
	Version int                `json:"version"`
}

type AddReactionData

type AddReactionData struct {
	MsgID    string
	CliMsgID string
}

type AddReactionDestination

type AddReactionDestination struct {
	ThreadID string
	Type     model.ThreadType
	Data     AddReactionData
}

type AddReactionFn

type AddReactionFn = func(ctx context.Context, dest AddReactionDestination, reaction model.ReactionData) (*AddReactionResponse, error)

type AddReactionResponse

type AddReactionResponse struct {
	MsgIDs []int `json:"msgIds"`
}

func (*AddReactionResponse) UnmarshalJSON

func (r *AddReactionResponse) UnmarshalJSON(data []byte) error

type AddUnreadMarkData

type AddUnreadMarkData struct {
	UpdateID int `json:"updateId"`
}

type AddUnreadMarkFn

type AddUnreadMarkFn = func(ctx context.Context, threadID string, threadType model.ThreadType) (*AddUnreadMarkResponse, error)

type AddUnreadMarkResponse

type AddUnreadMarkResponse struct {
	Data   AddUnreadMarkData `json:"data"`
	Status int               `json:"status"`
}

func (*AddUnreadMarkResponse) UnmarshalJSON

func (r *AddUnreadMarkResponse) UnmarshalJSON(data []byte) error

type AddUserToGroupFn

type AddUserToGroupFn = func(ctx context.Context, groupID string, userID ...string) (*AddUserToGroupResponse, error)

type AddUserToGroupResponse

type AddUserToGroupResponse struct {
	ErrorMembers []string            `json:"errorMembers"`
	ErrorData    map[string][]string `json:"error_data"`
}

type AutoDeleteConversation

type AutoDeleteConversation struct {
	DestID    string `json:"destId"`
	IsGroup   bool   `json:"isGroup"`
	TTL       int    `json:"ttl"`
	CreatedAt int64  `json:"createdAt"`
}

type BlockUserFn

type BlockUserFn = func(ctx context.Context, userID string) (BlockUserResponse, error)

type BlockUserResponse

type BlockUserResponse = string

type BoardItem

type BoardItem struct {
	BoardType model.BoardType `json:"boardType"`
	Data      model.BoardData `json:"data"` // model.PollDetail | model.NoteDetail | model.PinnedMessageDetail
}

func (*BoardItem) UnmarshalJSON

func (bi *BoardItem) UnmarshalJSON(data []byte) error

type ChangeGroupOwnerFn

type ChangeGroupOwnerFn = func(ctx context.Context, groupID string, memberID string) (*ChangeGroupOwnerResponse, error)

type ChangeGroupOwnerResponse

type ChangeGroupOwnerResponse struct {
	Time int64 `json:"time"`
}

type ChatTTL

type ChatTTL int
const (
	ChatTTLOff ChatTTL = 0
	ChatTTL24H ChatTTL = 86400000
	ChatTTL7D  ChatTTL = 7 * ChatTTL24H
	ChatTTL14D ChatTTL = 2 * ChatTTL7D
)

type CollapseConfig

type CollapseConfig struct {
	CollapseID    int `json:"collapseId"`
	CollapseXItem int `json:"collapseXItem"`
	CollapseYItem int `json:"collapseYItem"`
}

type CreateAutoReplyFn

type CreateAutoReplyFn = func(ctx context.Context, message CreateAutoReplyRequest) (*CreateAutoReplyResponse, error)

type CreateAutoReplyRequest

type CreateAutoReplyRequest struct {
	Content   string               `json:"content"`
	IsEnable  bool                 `json:"isEnable"`
	StartTime int64                `json:"startTime"`
	EndTime   int64                `json:"endTime"`
	Scope     model.AutoReplyScope `json:"scope"`
	UIDs      []string             `json:"uids"`
}

type CreateAutoReplyResponse

type CreateAutoReplyResponse struct {
	Item    model.AutoReplyItem `json:"item"`
	Version int                 `json:"version"`
}

type CreateCatalogFn

type CreateCatalogFn = func(ctx context.Context, name string) (*CreateCatalogResponse, error)

type CreateCatalogResponse

type CreateCatalogResponse struct {
	Item             model.CatalogItem `json:"item"`
	VersionLSCatalog int               `json:"version_ls_catalog"`
	VersionCatalog   int               `json:"version_catalog"`
}

type CreateGroupFn

type CreateGroupFn = func(ctx context.Context, options CreateGroupOptions) (*CreateGroupResponse, error)

type CreateGroupOptions

type CreateGroupOptions struct {
	Name    string
	Members []string
}

type CreateGroupResponse

type CreateGroupResponse struct {
	GroupType      model.GroupType `json:"groupType"`
	SuccessMembers []string        `json:"sucessMembers"`
	GroupID        string          `json:"groupId"`
	ErrorMembers   []string        `json:"errorMembers"`
	ErrorData      map[string]any  `json:"error_data"`
}

type CreateNoteFn

type CreateNoteFn = func(ctx context.Context, groupID string, options CreateNoteOptions) (*CreateNoteResponse, error)

type CreateNoteOptions

type CreateNoteOptions struct {
	Title  string `json:"title"`
	PinAct bool   `json:"pinAct"`
}

type CreateNoteResponse

type CreateNoteResponse = model.NoteDetail

type CreatePollFn

type CreatePollFn = func(ctx context.Context, groupID string, options CreatePollOptions) (*CreatePollResponse, error)

type CreatePollOptions

type CreatePollOptions struct {
	Question          string
	Options           []string
	ExpiredTime       int64
	AllowMultiChoices bool
	AllowAddNewOption bool
	HideVotePreview   bool
	IsAnonymous       bool
}

type CreatePollResponse

type CreatePollResponse = model.PollDetail

type CreateReminderFn

type CreateReminderFn = func(ctx context.Context, threadID string, threadType model.ThreadType, options CreateReminderOptions) (*CreateReminderResponse, error)

type CreateReminderGroup

type CreateReminderGroup struct {
	model.ReminderGroup
	GroupID     *string                `json:"groupId,omitempty"`
	EventType   *int                   `json:"eventType,omitempty"`
	RepeatData  *[]any                 `json:"repeatData,omitempty"`
	ResponseMem *model.ResponseMembers `json:"responseMem,omitempty"`
}

type CreateReminderOptions

type CreateReminderOptions struct {
	Title     string
	Emoji     string
	StartTime int64
	Repeat    model.ReminderRepeatMode
}

type CreateReminderUser

type CreateReminderUser = model.ReminderUser

type DeleteAutoReplyFn

type DeleteAutoReplyFn = func(ctx context.Context, id int) (*DeleteAutoReplyResponse, error)

type DeleteAutoReplyResponse

type DeleteAutoReplyResponse struct {
	Item    int `json:"item"`
	Version int `json:"version"`
}

type DeleteAvatarFn

type DeleteAvatarFn = func(ctx context.Context, photoID ...string) (*DeleteAvatarResponse, error)

type DeleteAvatarResponse

type DeleteAvatarResponse struct {
	DelPhotoIds []string     `json:"delPhotoIds"`
	ErrMap      model.ErrMap `json:"errMap"`
}

type DeleteCatalogFn

type DeleteCatalogFn = func(ctx context.Context, catalogID string) (DeleteCatalogResponse, error)

type DeleteCatalogResponse

type DeleteCatalogResponse = string

type DeleteChatFn

type DeleteChatFn = func(ctx context.Context, threadID string, threadType model.ThreadType, lastMsg DeleteChatLastMessage) (*DeleteChatResponse, error)

type DeleteChatLastMessage

type DeleteChatLastMessage struct {
	OwnerID     string
	CliMsgID    string
	GlobalMsgID string
}

type DeleteChatResponse

type DeleteChatResponse struct {
	Status int `json:"status"`
}

type DeleteGroupFn

type DeleteGroupFn = func(ctx context.Context, groupID string) (DeleteGroupResponse, error)

type DeleteGroupResponse

type DeleteGroupResponse = string

type DeleteMessageData

type DeleteMessageData struct {
	CliMsgID string
	MsgID    string
	UIDFrom  string
}

type DeleteMessageDestination

type DeleteMessageDestination struct {
	ThreadID string
	Type     model.ThreadType
	Data     DeleteMessageData
}

type DeleteMessageFn

type DeleteMessageFn = func(ctx context.Context, dest DeleteMessageDestination, onlyMe bool) (*DeleteMessageResponse, error)

type DeleteMessageResponse

type DeleteMessageResponse struct {
	Status int `json:"status"`
}

type DisableGroupLinkFn

type DisableGroupLinkFn = func(ctx context.Context, groupID string) (DisableGroupLinkResponse, error)

type DisableGroupLinkResponse

type DisableGroupLinkResponse = string

type EnableGroupLinkFn

type EnableGroupLinkFn = func(ctx context.Context, groupID string) (*EnableGroupLinkResponse, error)

type EnableGroupLinkResponse

type EnableGroupLinkResponse struct {
	Link           string `json:"link"`
	ExpirationDate int64  `json:"expiration_date"`
	Enabled        int    `json:"enabled"`
}

type FindUserFn

type FindUserFn = func(ctx context.Context, phoneNumber ...string) (*FindUserResponse, error)

type FindUserResponse

type FindUserResponse map[string]struct {
	Avatar      string                 `json:"avatar"`
	Cover       string                 `json:"cover"`
	Status      string                 `json:"status"`
	Gender      model.Gender           `json:"gender"`
	DOB         int64                  `json:"dob"`
	Sdob        string                 `json:"sdob"`
	GlobalID    string                 `json:"globalId"`
	BizPkg      model.ZBusinessPackage `json:"bizPkg"`
	UID         string                 `json:"uid"`
	ZaloName    string                 `json:"zalo_name"`
	DisplayName string                 `json:"display_name"`
}

type ForwardMessageFail

type ForwardMessageFail struct {
	ClientID  string `json:"clientId"`
	ErrorCode string `json:"error_code"`
}

type ForwardMessageFn

type ForwardMessageFn = func(ctx context.Context, threadIDs []string, threadType model.ThreadType, message ForwardMessagePayload) (*ForwardMessageResponse, error)

type ForwardMessagePayload

type ForwardMessagePayload struct {
	Message   string
	TTL       int
	Reference *ForwardMessageReference
}

type ForwardMessageReference

type ForwardMessageReference struct {
	ID         string
	TS         int
	LogSrcType int
	FwLvl      int
}

type ForwardMessageResponse

type ForwardMessageResponse struct {
	Success []ForwardMessageSuccess `json:"success"`
	Fail    []ForwardMessageFail    `json:"fail"`
}

type ForwardMessageSuccess

type ForwardMessageSuccess struct {
	ClientID string `json:"clientId"`
	MsgID    string `json:"msgId"`
}

type FriendRecType

type FriendRecType int
const (
	FriendRecRecommended FriendRecType = iota + 1
	FriendRecRequest                   // received friend request
)

type FriendRecommendation

type FriendRecommendation struct {
	UserID          string                 `json:"userId"`
	ZaloName        string                 `json:"zaloName"`
	DisplayName     string                 `json:"displayName"`
	Avatar          string                 `json:"avatar"`
	PhoneNumber     string                 `json:"phoneNumber"`
	Status          string                 `json:"status"`
	Gender          model.Gender           `json:"gender"`
	Dob             int64                  `json:"dob"`
	Type            int                    `json:"type"`
	RecommType      FriendRecType          `json:"recommType"`
	RecommSrc       int                    `json:"recommSrc"`
	RecommTime      int64                  `json:"recommTime"`
	RecommInfo      RecommendationMeta     `json:"recommInfo"`
	BizPkg          model.ZBusinessPackage `json:"bizPkg"`
	IsSeenFriendReq bool                   `json:"isSeenFriendReq"`
}

type FriendRequestInfo

type FriendRequestInfo struct {
	Message string `json:"message"`
	Src     int    `json:"src"`
	Time    int    `json:"time"`
}

type GIFContent

type GIFContent struct {
	Attachment model.AttachmentSource
	Thumb      *model.AttachmentSource
	TTL        int // Time to live in milliseconds
}

type GetAccountInfoFn

type GetAccountInfoFn = func(ctx context.Context) (*GetAccountInfoResponse, error)

type GetAccountInfoResponse

type GetAccountInfoResponse struct {
	Profile model.User `json:"profile"`
}

type GetAliasListFn

type GetAliasListFn = func(ctx context.Context, options model.OffsetPaginationOptions) (*GetAliasListResponse, error)

type GetAliasListItem

type GetAliasListItem struct {
	UserID string `json:"userid"`
	Alias  string `json:"alias"`
}

type GetAliasListResponse

type GetAliasListResponse struct {
	Items      []GetAliasListItem `json:"items"`
	UpdateTime string             `json:"updateTime"`
}

type GetAllFriendsFn

type GetAllFriendsFn = func(ctx context.Context, options model.OffsetPaginationOptions) (*GetAllFriendsResponse, error)

type GetAllFriendsResponse

type GetAllFriendsResponse []model.User

type GetAllGroupsFn

type GetAllGroupsFn = func(ctx context.Context) (*GetAllGroupsResponse, error)

type GetAllGroupsResponse

type GetAllGroupsResponse struct {
	Version    string        `json:"version"`
	GridVerMap GroupIDVerMap `json:"gridVerMap"`
}

type GetAutoDeleteChatFn

type GetAutoDeleteChatFn = func(ctx context.Context) (*GetAutoDeleteChatResponse, error)

type GetAutoDeleteChatResponse

type GetAutoDeleteChatResponse struct {
	Converts []AutoDeleteConversation `json:"converts"`
}

type GetAvatarListFn

type GetAvatarListFn = func(ctx context.Context, options model.OffsetPaginationOptions) (*GetAvatarListResponse, error)

type GetAvatarListResponse

type GetAvatarListResponse struct {
	AlbumID     string  `json:"albumId"`
	NextPhotoID string  `json:"nextPhotoId"`
	HasMore     int     `json:"hasMore"`
	Photos      []Photo `json:"photos"`
}

type GetFriendBoardListFn

type GetFriendBoardListFn = func(ctx context.Context, friendID string) (*GetFriendBoardListResponse, error)

type GetFriendBoardListResponse

type GetFriendBoardListResponse struct {
	Data    []model.PinnedMessageDetail `json:"data"`
	Version int                         `json:"version"`
}

type GetFriendOnlineStatusFn

type GetFriendOnlineStatusFn = func(ctx context.Context) (*GetFriendOnlineStatusResponse, error)

type GetFriendOnlineStatusResponse

type GetFriendOnlineStatusResponse struct {
	Predefine   []string       `json:"predefine"`
	OwnerStatus string         `json:"ownerStatus"`
	Onlines     []OnlineStatus `json:"onlines"`
}

type GetFriendRecommendationsFn

type GetFriendRecommendationsFn = func(ctx context.Context) (*GetFriendRecommendationsResponse, error)

type GetFriendRecommendationsResponse

type GetFriendRecommendationsResponse struct {
	ExpiredDuration       int64                `json:"expiredDuration"`
	CollapseMsgListConfig CollapseConfig       `json:"collapseMsgListConfig"`
	RecommItems           []RecommendationItem `json:"recommItems"`
}

type GetFriendRequestStatusFn

type GetFriendRequestStatusFn = func(ctx context.Context, friendID string) (*GetFriendRequestStatusResponse, error)

type GetFriendRequestStatusResponse

type GetFriendRequestStatusResponse struct {
	AddFriendPrivacy int  `json:"addFriendPrivacy"`
	IsSeenFriendReq  bool `json:"isSeenFriendReq"`
	IsFriend         int  `json:"is_friend"`
	IsRequested      int  `json:"is_requested"`
	IsRequesting     int  `json:"is_requesting"`
}

type GetGroupBlockedMemberFn

type GetGroupBlockedMemberFn = func(ctx context.Context, groupID string, options model.OffsetPaginationOptions) (*GetGroupBlockedMemberResponse, error)

type GetGroupBlockedMemberResponse

type GetGroupBlockedMemberResponse struct {
	BlockedMembers []model.UserSummary `json:"blocked_members"`
	HasMore        int                 `json:"has_more"`
}

type GetGroupBoardListFn

type GetGroupBoardListFn = func(ctx context.Context, groupID string, options model.OffsetPaginationOptions) (*GetGroupBoardListResponse, error)

type GetGroupBoardListResponse

type GetGroupBoardListResponse struct {
	Items []BoardItem `json:"items"`
	Count int         `json:"count"`
}

type GetGroupInfoFn

type GetGroupInfoFn = func(ctx context.Context, groupID ...string) (*GetGroupInfoResponse, error)

type GetGroupInfoResponse

type GetGroupInfoResponse struct {
	RemovedsGroup   []string             `json:"removedsGroup"`
	UnchangedsGroup []string             `json:"unchangedsGroup"`
	GridInfoMap     map[string]GroupInfo `json:"gridInfoMap"`
}

type GetGroupInviteBoxInfoFn

type GetGroupInviteBoxInfoFn = func(ctx context.Context, groupID string, options model.OffsetPaginationOptions) (*GetGroupInviteBoxInfoResponse, error)

type GetGroupInviteBoxInfoResponse

type GetGroupInviteBoxInfoResponse struct {
	GroupInfo        GroupInviteBoxInfo `json:"groupInfo"`
	InviterInfo      model.UserSummary  `json:"inviterInfo"`
	GroupCreatorInfo model.UserSummary  `json:"grCreatorInfo"`
	ExpiredTS        string             `json:"expiredTs"`
	Type             int                `json:"type"`
}

func (*GetGroupInviteBoxInfoResponse) UnmarshalJSON

func (r *GetGroupInviteBoxInfoResponse) UnmarshalJSON(data []byte) error

type GetGroupInviteBoxListOptions

type GetGroupInviteBoxListOptions struct {
	MPage      int
	Page       int
	InvPerPage int
	MCount     int
}

type GetGroupInviteBoxListResponse

type GetGroupInviteBoxListResponse struct {
	Invitations []Invitation `json:"invitations"`
	Total       int          `json:"total"`
	HasMore     bool         `json:"hasMore"`
}

type GetGroupLinkDetailFn

type GetGroupLinkDetailFn = func(ctx context.Context, groupID string) (*GetGroupLinkDetailResponse, error)

type GetGroupLinkDetailResponse

type GetGroupLinkDetailResponse struct {
	Link           *string `json:"link"`
	ExpirationDate *int64  `json:"expirationDate"`
	Enabled        int     `json:"enabled"` // 1: enabled, 0: disabled
}

type GetGroupLinkInfoFn

type GetGroupLinkInfoFn = func(ctx context.Context, link string, memberPage int) (*GetGroupLinkInfoResponse, error)

type GetGroupLinkInfoResponse

type GetGroupLinkInfoResponse struct {
	GroupID       string              `json:"groupId"`
	Name          string              `json:"name"`
	Desc          string              `json:"desc"`
	Type          int                 `json:"type"`
	CreatorID     string              `json:"creatorId"`
	Avt           string              `json:"avt"`
	FullAvt       string              `json:"fullAvt"`
	AdminIDs      []string            `json:"adminIds"`
	CurrentMems   []model.UserSummary `json:"currentMems"`
	Admins        []any               `json:"admins"`
	HasMoreMember int                 `json:"hasMoreMember"`
	SubType       int                 `json:"subType"`
	TotalMember   int                 `json:"totalMember"`
	Setting       model.GroupSetting  `json:"setting"`
	GlobalID      string              `json:"globalId"`
}

type GetGroupPendingJoinRequestsFn

type GetGroupPendingJoinRequestsFn = func(ctx context.Context, groupID string) (*GetGroupPendingJoinRequestsResponse, error)

type GetGroupPendingJoinRequestsResponse

type GetGroupPendingJoinRequestsResponse struct {
	Users []RequestUserInfo `json:"users"`
	Time  int64             `json:"time"`
}

type GetHiddenChatFn

type GetHiddenChatFn = func(ctx context.Context) (*GetHiddenChatResponse, error)

type GetHiddenChatResponse

type GetHiddenChatResponse struct {
	PIN     string         `json:"pin"`
	Threads []HiddenThread `json:"threads"`
}

type GetLabelsFn

type GetLabelsFn = func(ctx context.Context) (*GetLabelsResponse, error)

type GetLabelsResponse

type GetLabelsResponse struct {
	LabelData      []model.LabelData `json:"labelData"`
	Version        int               `json:"version"`
	LastUpdateTime int64             `json:"lastUpdateTime"`
}

func (*GetLabelsResponse) UnmarshalJSON

func (r *GetLabelsResponse) UnmarshalJSON(data []byte) error

type GetMuteFn

type GetMuteFn = func(ctx context.Context) (*GetMuteResponse, error)

type GetMuteResponse

type GetMuteResponse struct {
	ChatEntries      []MuteEntriesInfo `json:"chatEntries"`
	GroupChatEntries []MuteEntriesInfo `json:"groupChatEntries"`
}

type GetPinnedChatFn

type GetPinnedChatFn = func(ctx context.Context) (*GetPinnedChatResponse, error)

type GetPinnedChatResponse

type GetPinnedChatResponse struct {
	Conversations []string `json:"conversations"`
	Version       int      `json:"version"`
}

type GetPollDetailFn

type GetPollDetailFn = func(ctx context.Context, pollID int) (*GetPollDetailResponse, error)

type GetPollDetailResponse

type GetPollDetailResponse = model.PollDetail

type GetQRFn

type GetQRFn = func(ctx context.Context, userID ...string) (*GetQRResponse, error)

type GetQRResponse

type GetQRResponse map[string]string

type GetQuickMessageListFn

type GetQuickMessageListFn = func(ctx context.Context) (*GetQuickMessageListResponse, error)

type GetQuickMessageListResponse

type GetQuickMessageListResponse struct {
	Cursor  int                  `json:"cursor"`
	Version int                  `json:"version"`
	Items   []model.QuickMessage `json:"items"`
}

type GetReminderFn

type GetReminderFn = func(ctx context.Context, reminderID string) (*GetReminderResponse, error)

type GetReminderListFn

type GetReminderListFn = func(ctx context.Context, threadID string, threadType model.ThreadType, options model.OffsetPaginationOptions) (*GetReminderListResponse, error)

type GetReminderResponse

type GetReminderResponse = model.ReminderGroup

type GetReminderResponseFn

type GetReminderResponseFn = func(ctx context.Context, reminderID string) (*GetReminderResponseResponse, error)

type GetReminderResponseResponse

type GetReminderResponseResponse struct {
	RejectMember []string `json:"rejectMember"`
	AcceptMember []string `json:"acceptMember"`
}

type GetSentFriendRequestFn

type GetSentFriendRequestFn = func(ctx context.Context) (*GetSentFriendRequestResponse, error)

type GetSentFriendRequestResponse

type GetSentFriendRequestResponse map[string]SentFriendRequestInfo

type GetSettingFn

type GetSettingFn = func(ctx context.Context) (*GetSettingResponse, error)

type GetSettingResponse

type GetSettingResponse = model.UserSetting

type GetStickerDetailFn

type GetStickerDetailFn = func(ctx context.Context, stickerID int) (*GetStickerDetailResponse, error)

type GetStickerDetailResponse

type GetStickerDetailResponse = model.StickerDetail

type GetStickersFn

type GetStickersFn = func(ctx context.Context, keyword string) (*GetStickersResponse, error)

type GetStickersResponse

type GetStickersResponse = model.StickerSuggestions

type GetUnreadMarkData

type GetUnreadMarkData struct {
	ConvsGroup []UnreadMark `json:"convsGroup"`
	ConvsUser  []UnreadMark `json:"convsUser"`
}

type GetUnreadMarkFn

type GetUnreadMarkFn = func(ctx context.Context) (*GetUnreadMarkResponse, error)

type GetUnreadMarkResponse

type GetUnreadMarkResponse struct {
	Data   GetUnreadMarkData `json:"data"`
	Status int               `json:"status"`
}

func (*GetUnreadMarkResponse) UnmarshalJSON

func (r *GetUnreadMarkResponse) UnmarshalJSON(data []byte) error

type GetUserInfoFn

type GetUserInfoFn = func(ctx context.Context, userId ...string) (*GetUserInfoResponse, error)

type GetUserInfoResponse

type GetUserInfoResponse struct {
	UnchangedProfiles map[string]any        `json:"unchanged_profiles"`
	PhonebookVersion  uint                  `json:"phonebook_version"`
	ChangedProfiles   map[string]model.User `json:"changed_profiles"`
}

type GetUserSummaryInfoFn

type GetUserSummaryInfoFn = func(ctx context.Context, userID ...string) (*GetUserSummaryInfoResponse, error)

type GetUserSummaryInfoResponse

type GetUserSummaryInfoResponse struct {
	Profiles          map[string]UserProfile `json:"profiles"`
	UnchangedsProfile []any                  `json:"unchangeds_profile"`
}

type GroupIDVerMap

type GroupIDVerMap map[string]string

type GroupInfo

type GroupInfo struct {
	model.GroupInfo
	MemVerList     []string                `json:"memVerList"`
	PendingApprove GroupInfoPendingApprove `json:"pendingApprove"`
}

type GroupInfoPendingApprove

type GroupInfoPendingApprove struct {
	Time int64    `json:"time"`
	UIDs []string `json:"uids"`
}

type GroupInviteBoxInfo

type GroupInviteBoxInfo struct {
	model.GroupInfo
	Topic *GroupInviteBoxInfoTopic `json:"topic,omitempty"`
}

type GroupInviteBoxInfoTopic

type GroupInviteBoxInfoTopic struct {
	model.GroupTopic
	Action *int `json:"action,omitempty"`
}

type HiddenThread

type HiddenThread struct {
	IsGroup  int    `json:"is_group"` // 1: true, 0: false
	ThreadID string `json:"thread_id"`
}

type Invitation

type Invitation struct {
	GroupInfo        model.GroupInfo   `json:"groupInfo"`
	InviterInfo      model.UserSummary `json:"inviterInfo"`
	GroupCreatorInfo model.UserSummary `json:"grCreatorInfo"`
	ExpiredTS        string            `json:"expiredTs"` // Expired timestamp max 7 days
	Type             int               `json:"type"`
}

type InviteUserToGroupsFn

type InviteUserToGroupsFn = func(ctx context.Context, userID string, groupID ...string) (*InviteUserToGroupsResponse, error)

type InviteUserToGroupsMessage

type InviteUserToGroupsMessage struct {
	ErrorCode    int     `json:"error_code"`
	ErrorMessage string  `json:"error_message"`
	Data         *string `json:"data"`
}

type InviteUserToGroupsResponse

type InviteUserToGroupsResponse struct {
	GridMessageMap map[string]InviteUserToGroupsMessage `json:"grid_message_map"`
}

type JoinGroupInviteBoxFn

type JoinGroupInviteBoxFn = func(ctx context.Context, groupID string) (JoinGroupInviteBoxResponse, error)

type JoinGroupInviteBoxResponse

type JoinGroupInviteBoxResponse = string

type JoinGroupLinkFn

type JoinGroupLinkFn = func(ctx context.Context, link string) (JoinGroupLinkResponse, error)

type JoinGroupLinkResponse

type JoinGroupLinkResponse = string

type Language

type Language string
const (
	LanguageVietnamese Language = "VI"
	LanguageEnglish    Language = "EN"
)

type LastOnlineFn

type LastOnlineFn = func(ctx context.Context, userID string) (*LastOnlineResponse, error)

type LastOnlineResponse

type LastOnlineResponse struct {
	Settings   LastOnlineSettings `json:"settings"`
	LastOnline int64              `json:"lastOnline"`
}

type LastOnlineSettings

type LastOnlineSettings struct {
	ShowOnlineStatus bool `json:"show_online_status"`
}

type LeaveGroupFn

type LeaveGroupFn = func(ctx context.Context, groupID string, isSilent bool) (*LeaveGroupResponse, error)

type LeaveGroupResponse

type LeaveGroupResponse struct {
	MemberError []any `json:"memberError"`
}

type LockPollFn

type LockPollFn = func(ctx context.Context, pollID int) (LockPollResponse, error)

type LockPollResponse

type LockPollResponse = string

type MessageContent

type MessageContent struct {
	Msg     string
	Style   []MessageStyle
	Urgency model.Urgency

	Quote       *SendMessageQuote
	Mentions    []model.TMention
	Attachments []model.AttachmentSource
	TTL         int // Time to live in milliseconds
}

func (*MessageContent) IsPhotoDescription

func (c *MessageContent) IsPhotoDescription() bool

type MessageStyle

type MessageStyle struct {
	Start int       `json:"start"`
	Len   int       `json:"len"`
	Style TextStyle `json:"st"`

	IndentSize int `json:"indentSize"` // Used for indent style
}

type MuteAction

type MuteAction int

type MuteEntriesInfo

type MuteEntriesInfo struct {
	ID          string `json:"id"`
	Duration    int    `json:"duration"`
	StartTime   int64  `json:"startTime"`
	SystemTime  int64  `json:"systemTime"`
	CurrentTime int64  `json:"currentTime"`
	MuteMode    int    `json:"muteMode"`
}

type OnlineStatus

type OnlineStatus struct {
	UserID string `json:"userId"`
	Status string `json:"status"`
}

type ParseLinkData

type ParseLinkData struct {
	Thumb      string         `json:"thumb"`
	Title      string         `json:"title"`
	Desc       string         `json:"desc"`
	Src        string         `json:"src"`
	Href       string         `json:"href"`
	Media      ParseLinkMedia `json:"media"`
	StreamIcon string         `json:"stream_icon"`
}

type ParseLinkFn

type ParseLinkFn = func(ctx context.Context, link string) (*ParseLinkResponse, error)

type ParseLinkMedia

type ParseLinkMedia struct {
	Type       int    `json:"type"`
	Count      int    `json:"count"`
	MediaTitle string `json:"mediaTitle"`
	Artist     string `json:"artist"`
	StreamURL  string `json:"streamUrl"`
	StreamIcon string `json:"stream_icon"`
}

type ParseLinkResponse

type ParseLinkResponse struct {
	Data     ParseLinkData  `json:"data"`
	ErrorMap map[string]int `json:"error_maps"`
}

type Photo

type Photo struct {
	PhotoID   string `json:"photoId"`
	Thumbnail string `json:"thumbnail"`
	URL       string `json:"url"`
	BkURL     string `json:"bkUrl"`
}

type RecommendationItem

type RecommendationItem struct {
	RecommItemType int                  `json:"recommItemType"`
	DataInfo       FriendRecommendation `json:"dataInfo"`
}

type RecommendationMeta

type RecommendationMeta struct {
	SuggestWay int     `json:"suggestWay"`
	Source     int     `json:"source"`
	Message    string  `json:"message"`
	CustomText *string `json:"customText"` // nullable in JSON
}

type RejectFriendRequestFn

type RejectFriendRequestFn = func(ctx context.Context, friendID string) (RejectFriendRequestResponse, error)

type RejectFriendRequestResponse

type RejectFriendRequestResponse = string

type ReminderListGroup

type ReminderListGroup = model.ReminderGroup

type ReminderListUser

type ReminderListUser = model.ReminderUser

type RemoveAliasFn

type RemoveAliasFn = func(ctx context.Context, userID string) (RemoveAliasResponse, error)

type RemoveAliasResponse

type RemoveAliasResponse = string

type RemoveFriendFn

type RemoveFriendFn = func(ctx context.Context, friendID string) (RemoveFriendResponse, error)

type RemoveFriendResponse

type RemoveFriendResponse = string

type RemoveGroupBlockedMemberFn

type RemoveGroupBlockedMemberFn = func(ctx context.Context, groupID string, memberID ...string) (RemoveGroupBlockedMemberResponse, error)

type RemoveGroupBlockedMemberResponse

type RemoveGroupBlockedMemberResponse = string

type RemoveGroupDeputyFn

type RemoveGroupDeputyFn = func(ctx context.Context, groupID string, memberID ...string) (RemoveGroupDeputyResponse, error)

type RemoveGroupDeputyResponse

type RemoveGroupDeputyResponse = string

type RemoveGroupInviteBoxFn

type RemoveGroupInviteBoxFn = func(ctx context.Context, blockFutureInvite bool, groupID ...string) (*RemoveGroupInviteBoxResponse, error)

type RemoveGroupInviteBoxResponse

type RemoveGroupInviteBoxResponse struct {
	DelInvitationIds []string     `json:"delInvitaionIds"`
	ErrMap           model.ErrMap `json:"errMap"`
}

type RemoveQuickMessageFn

type RemoveQuickMessageFn = func(ctx context.Context, messageID ...int) (*RemoveQuickMessageResponse, error)

type RemoveQuickMessageResponse

type RemoveQuickMessageResponse struct {
	ItemIDs []int `json:"itemIds"`
	Version int   `json:"version"`
}

type RemoveReminderFn

type RemoveReminderFn = func(ctx context.Context, threadID string, threadType model.ThreadType, reminderID string) (RemoveReminderResponse, error)

type RemoveReminderResponse

type RemoveReminderResponse = string

type RemoveUnreadMarkData

type RemoveUnreadMarkData struct {
	UpdateID int `json:"updateId"`
}

type RemoveUnreadMarkFn

type RemoveUnreadMarkFn = func(ctx context.Context, threadID string, threadType model.ThreadType) (*RemoveUnreadMarkResponse, error)

type RemoveUnreadMarkResponse

type RemoveUnreadMarkResponse struct {
	Data   RemoveUnreadMarkData `json:"data"`
	Status int                  `json:"status"`
}

func (*RemoveUnreadMarkResponse) UnmarshalJSON

func (r *RemoveUnreadMarkResponse) UnmarshalJSON(data []byte) error

type RemoveUserFromGroupFn

type RemoveUserFromGroupFn = func(ctx context.Context, groupID string, memberID ...string) (*RemoveUserFromGroupResponse, error)

type RemoveUserFromGroupResponse

type RemoveUserFromGroupResponse struct {
	ErrorMembers []string `json:"errorMembers"`
}

type ReportReason

type ReportReason int
const (
	ReportReasonOther ReportReason = iota
	ReportReasonSensitive
	ReportReasonAnnoying
	ReportReasonFraud
)

type RequestUserInfo

type RequestUserInfo struct {
	UID    string `json:"uid"`
	DPN    string `json:"dpn"`
	Avatar string `json:"avatar"`
}

type ResetHiddenChatPINFn

type ResetHiddenChatPINFn = func(ctx context.Context) (ResetHiddenChatPINResponse, error)

type ResetHiddenChatPINResponse

type ResetHiddenChatPINResponse = string

type ReuseAvatarFn

type ReuseAvatarFn = func(ctx context.Context, photoID string) (*ReuseAvatarResponse, error)

type ReuseAvatarResponse

type ReuseAvatarResponse = struct{} // Always null

type ReviewPendingMemberData

type ReviewPendingMemberData struct {
	Members   []string
	IsApprove bool
}

type ReviewPendingMemberRequestFn

type ReviewPendingMemberRequestFn = func(ctx context.Context, groupID string, data ReviewPendingMemberData) (*ReviewPendingMemberRequestResponse, error)

type ReviewPendingMemberRequestResponse

type ReviewPendingMemberRequestResponse map[string]ReviewPendingMemberRequestStatus

type ReviewPendingMemberRequestStatus

type ReviewPendingMemberRequestStatus int
const (
	ReviewStatusSuccess                ReviewPendingMemberRequestStatus = 0
	ReviewStatusNotInPendingList       ReviewPendingMemberRequestStatus = 170
	ReviewStatusAlreadyInGroup         ReviewPendingMemberRequestStatus = 178
	ReviewStatusInsufficientPermission ReviewPendingMemberRequestStatus = 166
)

type SendBankCardData

type SendBankCardData struct {
	BinBank     model.BinBankCard
	NumAccBank  string
	NameAccBank string
}

type SendBankCardFn

type SendBankCardFn = func(ctx context.Context, threadID string, threadType model.ThreadType, data SendBankCardData) (SendBankCardResponse, error)

type SendBankCardResponse

type SendBankCardResponse = string

type SendCardFn

type SendCardFn = func(ctx context.Context, threadID string, threadType model.ThreadType, options SendCardOptions) (*SendCardResponse, error)

type SendCardOptions

type SendCardOptions struct {
	UserID      string
	PhoneNumber string
	TTL         int
}

type SendCardResponse

type SendCardResponse struct {
	MsgID int `json:"msgId"`
}

type SendDeliveredEventFn

type SendDeliveredEventFn = func(ctx context.Context, messages []model.OutboundMessage, threadType model.ThreadType, isSeen bool) (SendDeliveredEventResponse, error)

type SendDeliveredEventResponse

type SendDeliveredEventResponse = string // string | { status: int }

type SendFriendRequestFn

type SendFriendRequestFn = func(ctx context.Context, message string, userID string) (SendFriendRequestResponse, error)

type SendFriendRequestResponse

type SendFriendRequestResponse = string

type SendGIFFn

type SendGIFFn = func(ctx context.Context, threadID string, threadType model.ThreadType, gif GIFContent) (*SendGIFResponse, error)

type SendGIFResponse

type SendGIFResponse struct {
	MsgID string `json:"msgId"`
	Href  string `json:"href"`
}

type SendLinkFn

type SendLinkFn = func(ctx context.Context, threadID string, threadType model.ThreadType, options SendLinkOptions) (*SendLinkResponse, error)

type SendLinkOptions

type SendLinkOptions struct {
	Msg      string
	Link     string
	TTL      int
	Mentions []model.TMention
}

type SendLinkResponse

type SendLinkResponse struct {
	MsgID string `json:"msgId"`
}

type SendMessageFn

type SendMessageFn = func(ctx context.Context, threadID string, threadType model.ThreadType, message MessageContent) (*SendMessageResponse, error)

type SendMessageQuote

type SendMessageQuote struct {
	MsgID    string `json:"msgId"`
	CliMsgID string `json:"cliMsgId"`
	MsgType  string `json:"msgType"`
	UIDFrom  string `json:"uidFrom"`

	Content     model.Content      `json:"content"`
	PropertyExt *model.PropertyExt `json:"propertyExt,omitempty"`

	TS  string `json:"ts"`
	TTL int    `json:"ttl"`
}

func (*SendMessageQuote) BuildAttachmentMessagePayload

func (q *SendMessageQuote) BuildAttachmentMessagePayload() any

func (*SendMessageQuote) BuildMessagePayload

func (q *SendMessageQuote) BuildMessagePayload() any

func (*SendMessageQuote) GetMessageType

func (q *SendMessageQuote) GetMessageType() int

type SendMessageResponse

type SendMessageResponse struct {
	Message    *SendMessageResult  `json:"message"`
	Attachment []SendMessageResult `json:"attachment"`
}

type SendMessageResult

type SendMessageResult struct {
	MsgID string `json:"msgId"`
}

type SendReportFn

type SendReportFn = func(ctx context.Context, threadID string, threadType model.ThreadType, options SendReportOptions) (*SendReportResponse, error)

type SendReportOptions

type SendReportOptions struct {
	Content string // Only used when Reason is ReportReasonOther
	Reason  ReportReason
}

type SendReportResponse

type SendReportResponse struct {
	ReportID string `json:"reportId"`
}

type SendSeenEventFn

type SendSeenEventFn = func(ctx context.Context, messages []model.OutboundMessage, threadType model.ThreadType) (*SendSeenEventResponse, error)

type SendSeenEventResponse

type SendSeenEventResponse struct {
	Status int `json:"status"`
}

type SendStickerFn

type SendStickerFn = func(ctx context.Context, threadID string, threadType model.ThreadType, sticker SendStickerPayload) (*SendStickerResponse, error)

type SendStickerPayload

type SendStickerPayload struct {
	ID     int `json:"id"`
	CateID int `json:"cateId"`
	Type   int `json:"type"`
}

type SendStickerResponse

type SendStickerResponse struct {
	MsgID string `json:"msgId"`
}

type SendTypingEventFn

type SendTypingEventFn = func(ctx context.Context, threadID string, threadType model.ThreadType, destType model.DestType) (*SendTypingEventResponse, error)

type SendTypingEventResponse

type SendTypingEventResponse struct {
	Status int `json:"status"`
}

func (*SendTypingEventResponse) UnmarshalJSON

func (r *SendTypingEventResponse) UnmarshalJSON(data []byte) error

type SendVideoFn

type SendVideoFn = func(ctx context.Context, threadID string, threadType model.ThreadType, options SendVideoOptions) (*SendVideoResponse, error)

type SendVideoOptions

type SendVideoOptions struct {
	Msg          string // Optional message to send along with the video
	VideoURL     string // URL of the video
	ThumbnailURL string // URL of the thumbnail
	Duration     int    // Video duration in milliseconds
	Width        int    // Width of the video
	Height       int    // Height of the video
	TTL          int    // Time to live in milliseconds
}

type SendVideoResponse

type SendVideoResponse struct {
	MsgID int `json:"msgId"`
}

type SendVoiceFn

type SendVoiceFn = func(ctx context.Context, threadID string, threadType model.ThreadType, options SendVoiceOptions) (*SendVoiceResponse, error)

type SendVoiceOptions

type SendVoiceOptions struct {
	VoiceURL string // URL of the voice
	TTL      int    // Time to live in milliseconds
}

type SendVoiceResponse

type SendVoiceResponse struct {
	MsgID int `json:"msgId"`
}

type SentFriendRequestInfo

type SentFriendRequestInfo struct {
	UserID      string                 `json:"userId"`
	ZaloName    string                 `json:"zaloName"`
	DisplayName string                 `json:"displayName"`
	Avatar      string                 `json:"avatar"`
	GlobalID    string                 `json:"globalId"`
	BizPkg      model.ZBusinessPackage `json:"bizPkg"`
	FReqInfo    FriendRequestInfo      `json:"fReqInfo"`
}

type SetHiddenChatFn

type SetHiddenChatFn = func(ctx context.Context, threadID []string, threadType model.ThreadType, isHidden bool) (SetHiddenChatResponse, error)

type SetHiddenChatResponse

type SetHiddenChatResponse = string

type SetMuteFn

type SetMuteFn = func(ctx context.Context, threadID string, threadType model.ThreadType, options SetMuteOptions) (SetMuteResponse, error)

type SetMuteOptions

type SetMuteOptions struct {
	Duration int // Mute duration in seconds.
	Action   MuteAction
}

type SetMuteResponse

type SetMuteResponse = string

type SetPinChatFn

type SetPinChatFn = func(ctx context.Context, threadID []string, threadType model.ThreadType, isPinned bool) (SetPinChatResponse, error)

type SetPinChatResponse

type SetPinChatResponse = string

type SetViewFeedBlockFn

type SetViewFeedBlockFn = func(ctx context.Context, userID string, isBlock bool) (SetViewFeedBlockResponse, error)

type SetViewFeedBlockResponse

type SetViewFeedBlockResponse = string

type SharePollFn

type SharePollFn = func(ctx context.Context, pollID int) (SharePollResponse, error)

type SharePollResponse

type SharePollResponse = string

type TextStyle

type TextStyle string
const (
	TextStyleBold          TextStyle = "b"
	TextStyleItalic        TextStyle = "i"
	TextStyleUnderline     TextStyle = "u"
	TextStyleStrikeThrough TextStyle = "s"

	TextStyleRed    TextStyle = "c_db342e"
	TextStyleOrange TextStyle = "c_f27806"
	TextStyleYellow TextStyle = "c_f7b503"
	TextStyleGreen  TextStyle = "c_15a85f"

	TextStyleSmall TextStyle = "f_13"
	TextStyleBig   TextStyle = "f_18"

	TextStyleOrderedList   TextStyle = "lst_2"
	TextStyleUnorderedList TextStyle = "lst_1"

	TextStyleIndent TextStyle = "ind_$"
)

type UnblockUserFn

type UnblockUserFn = func(ctx context.Context, userID string) (UnblockUserResponse, error)

type UnblockUserResponse

type UnblockUserResponse = string

type UndoFriendRequestFn

type UndoFriendRequestFn = func(ctx context.Context, userID string) (UndoFriendRequestResponse, error)

type UndoFriendRequestResponse

type UndoFriendRequestResponse = string

type UndoMessageData

type UndoMessageData struct {
	MsgID    string
	CliMsgID string
}

type UndoMessageFn

type UndoMessageFn = func(ctx context.Context, threadID string, threadType model.ThreadType, data UndoMessageData) (*UndoMessageResponse, error)

type UndoMessageResponse

type UndoMessageResponse struct {
	Status int `json:"status"`
}

type UnreadMark

type UnreadMark struct {
	ID       int `json:"id"`
	CliMsgID int `json:"cliMsgId"`
	FromUID  int `json:"fromUid"`
	TS       int `json:"ts"`
}

type UpdateAccountAvatarFn

type UpdateAccountAvatarFn = func(ctx context.Context, source model.AttachmentSource) (UpdateAccountAvatarResponse, error)

type UpdateAccountAvatarResponse

type UpdateAccountAvatarResponse = string

type UpdateActiveStatusFn

type UpdateActiveStatusFn = func(ctx context.Context, isActive bool) (*UpdateActiveStatusResponse, error)

type UpdateActiveStatusResponse

type UpdateActiveStatusResponse struct {
	Status bool `json:"status"`
}

type UpdateAliasFn

type UpdateAliasFn = func(ctx context.Context, userID string, alias string) (UpdateAliasResponse, error)

type UpdateAliasResponse

type UpdateAliasResponse = string

type UpdateAutoDeleteChatFn

type UpdateAutoDeleteChatFn = func(ctx context.Context, threadID string, threadType model.ThreadType, ttl ChatTTL) (UpdateAutoDeleteChatResponse, error)

type UpdateAutoDeleteChatResponse

type UpdateAutoDeleteChatResponse = string

type UpdateGroupAvatarFn

type UpdateGroupAvatarFn = func(ctx context.Context, groupID string, source model.AttachmentSource) (UpdateGroupAvatarResponse, error)

type UpdateGroupAvatarResponse

type UpdateGroupAvatarResponse = string

type UpdateGroupNameFn

type UpdateGroupNameFn = func(ctx context.Context, groupID string, name string) (*UpdateGroupNameResponse, error)

type UpdateGroupNameResponse

type UpdateGroupNameResponse struct {
	Status int `json:"status"`
}

type UpdateGroupSettingFn

type UpdateGroupSettingFn = func(ctx context.Context, groupID string, options UpdateGroupSettingOptions) (UpdateGroupSettingResponse, error)

type UpdateGroupSettingOptions

type UpdateGroupSettingOptions struct {
	BlockName        bool // Disallow group members to change the group name and avatar
	SignAdminMsg     bool // Highlight messages from owner/admins
	SetTopicOnly     bool // Don't pin messages, notes, and polls to the top of a conversation
	EnableMsgHistory bool // Allow new members to read most recent messages
	JoinApproval     bool // Require approval for new members to join the group
	LockCreatePost   bool // Disallow group members to create notes & reminders
	LockCreatePoll   bool // Disallow group members to create polls
	LockSendMsg      bool // Disallow group members to send messages
	LockViewMember   bool // Disallow group members to view full member list (community only)

}

type UpdateGroupSettingResponse

type UpdateGroupSettingResponse = string

type UpdateHiddenChatPINFn

type UpdateHiddenChatPINFn = func(ctx context.Context, pin string) (UpdateHiddenChatPINResponse, error)

type UpdateHiddenChatPINResponse

type UpdateHiddenChatPINResponse = string

type UpdateLabelsData

type UpdateLabelsData struct {
	LabelData []model.LabelData
	Version   int
}

type UpdateLabelsFn

type UpdateLabelsFn = func(ctx context.Context, labels UpdateLabelsData) (*UpdateLabelsResponse, error)

type UpdateLabelsResponse

type UpdateLabelsResponse struct {
	LabelData      []model.LabelData
	Version        int
	LastUpdateTime int64
}

func (*UpdateLabelsResponse) UnmarshalJSON

func (r *UpdateLabelsResponse) UnmarshalJSON(data []byte) error

type UpdateLanguageFn

type UpdateLanguageFn = func(ctx context.Context, lang Language) (UpdateLanguageResponse, error)

type UpdateLanguageResponse

type UpdateLanguageResponse = string

type UpdateNoteFn

type UpdateNoteFn = func(ctx context.Context, groupID string, options UpdateNoteOptions) (*UpdateNoteResponse, error)

type UpdateNoteOptions

type UpdateNoteOptions struct {
	Title   string
	TopicId string
	PinAct  bool
}

type UpdateNoteResponse

type UpdateNoteResponse = model.NoteDetail

type UpdateProfileBiz

type UpdateProfileBiz struct {
	Category    model.BusinessCategory `json:"cate,omitempty"`
	Description string                 `json:"desc,omitempty"`
	Address     string                 `json:"addr,omitempty"`
	Website     string                 `json:"website,omitempty"`
	Email       string                 `json:"email,omitempty"`
}

type UpdateProfileData

type UpdateProfileData struct {
	Profile UpdateProfileProfile
	Biz     UpdateProfileBiz
}

type UpdateProfileFn

type UpdateProfileFn = func(ctx context.Context, data UpdateProfileData) (UpdateProfileResponse, error)

type UpdateProfileProfile

type UpdateProfileProfile struct {
	Name   string       `json:"name"`
	DOB    string       `json:"dob"` // Date of Birth in format "YYYY-MM-DD"
	Gender model.Gender `json:"gender"`
}

type UpdateProfileResponse

type UpdateProfileResponse = string

type UpdateQuickMessageData

type UpdateQuickMessageData struct {
	Keyword string
	Title   string
	Media   *model.AttachmentSource
}

type UpdateQuickMessageFn

type UpdateQuickMessageFn = func(ctx context.Context, itemID string, data UpdateQuickMessageData) (*UpdateQuickMessageResponse, error)

type UpdateQuickMessageResponse

type UpdateQuickMessageResponse struct {
	Item    model.QuickMessage `json:"item"`
	Version int                `json:"version"`
}

type UpdateReminderFn

type UpdateReminderFn = func(ctx context.Context, threadID string, threadType model.ThreadType, options UpdateReminderOptions) (*UpdateReminderResponse, error)

type UpdateReminderGroup

type UpdateReminderGroup struct {
	model.ReminderGroup
	ResponseMem *model.ResponseMembers `json:"responseMem,omitempty"`
}

type UpdateReminderOptions

type UpdateReminderOptions struct {
	Title     string
	TopicId   string
	Emoji     string
	StartTime int64
	Repeat    model.ReminderRepeatMode
}

type UpdateReminderUser

type UpdateReminderUser = model.ReminderUser

type UpdateSettingFn

type UpdateSettingFn = func(ctx context.Context, sType UpdateSettingType, value int) (UpdateSettingResponse, error)

type UpdateSettingResponse

type UpdateSettingResponse = string

type UpdateSettingType

type UpdateSettingType string
const (
	// 0 = hide, 1 = show full (day/month/year), 2 = show day/month.
	UpdateViewBirthday UpdateSettingType = "view_birthday"
	// 0 = hide, 1 = show.
	UpdateShowOnlineStatus UpdateSettingType = "show_online_status"
	// 0 = hide, 1 = show.
	UpdateDisplaySeenStatus UpdateSettingType = "display_seen_status"
	// 1 = everyone, 2 = only friends.
	UpdateReceiveMessage UpdateSettingType = "receive_message"
	// 2 = only friends, 3 = everyone, 4 = friends and recent contacts.
	UpdateAcceptCall UpdateSettingType = "accept_stranger_call"
	// 0 = disable, 1 = enable.
	UpdateAddFriendViaPhone UpdateSettingType = "add_friend_via_phone"
	// 0 = disable, 1 = enable.
	UpdateAddFriendViaQR UpdateSettingType = "add_friend_via_qr"
	// 0 = disable, 1 = enable.
	UpdateAddFriendViaGroup UpdateSettingType = "add_friend_via_group"
	// 0 = disable, 1 = enable.
	UpdateAddFriendViaContact UpdateSettingType = "add_friend_via_contact"
	// 0 = disable, 1 = enable.
	UpdateDisplayOnRecommendFriend UpdateSettingType = "display_on_recommend_friend"
	// 0 = disable, 1 = enable.
	UpdateArchivedChat UpdateSettingType = "archivedChatStatus"
	// 0 = disable, 1 = enable.
	UpdateQuickMessage UpdateSettingType = "quickMessageStatus"
)

type UploadAttachment

type UploadAttachment struct {
	Finished     bool           `json:"finished"`
	ClientFileID int            `json:"clientFileId"`
	ChunkID      int            `json:"chunkId"`
	FileType     model.FileType `json:"fileType"` // "image" | "video" | "others"
	TotalSize    int64          `json:"totalSize"`

	Image *UploadImageInfo `json:"-"`
	File  *UploadFileInfo  `json:"-"`
}

type UploadAttachmentFn

type UploadAttachmentFn = func(ctx context.Context, threadID string, threadType model.ThreadType, sources ...model.AttachmentSource) (UploadAttachmentResponse, error)

type UploadAttachmentResponse

type UploadAttachmentResponse = []UploadAttachment

type UploadFileInfo

type UploadFileInfo struct {
	FileID   string `json:"fileId"`
	FileURL  string `json:"fileUrl"`
	FileName string `json:"fileName"`
	Checksum string `json:"checksum"`
}

type UploadImageInfo

type UploadImageInfo struct {
	PhotoID   string `json:"photoId"`
	HDURL     string `json:"hdUrl"`
	ThumbURL  string `json:"thumbUrl"`
	NormalURL string `json:"normalUrl"`
	Width     int    `json:"width"`
	Height    int    `json:"height"`
	HDSize    int64  `json:"hdSize"`
}

type UploadPhotoFn

type UploadPhotoFn = func(ctx context.Context, source model.AttachmentSource) (*UploadPhotoResponse, error)

type UploadPhotoResponse

type UploadPhotoResponse struct {
	NormalURL    string `json:"normalUrl"`
	PhotoID      string `json:"photoId"`
	Finished     int    `json:"finished"`
	HdURL        string `json:"hdUrl"`
	ThumbURL     string `json:"thumbUrl"`
	ClientFileID int    `json:"clientFileId"`
	ChunkID      int    `json:"chunkId"`
}

type UploadThumbnailFn

type UploadThumbnailFn = func(ctx context.Context, source model.AttachmentSource) (*UploadThumbnailResponse, error)

type UploadThumbnailResponse

type UploadThumbnailResponse struct {
	HDURL        string `json:"hdUrl"`
	URL          string `json:"url"`
	ClientFileID int    `json:"clientFileId"`
	FileID       int    `json:"fileId"`
}

type UserProfile

type UserProfile struct {
	DisplayName    string `json:"displayName"`
	ZaloName       string `json:"zaloName"`
	Avatar         string `json:"avatar"`
	AccountStatus  int    `json:"accountStatus"`
	Type           int    `json:"type"`
	LastUpdateTime int64  `json:"lastUpdateTime"`
	ID             string `json:"id"`
}

type VotePollFn

type VotePollFn = func(ctx context.Context, pollID string, optionID ...int) (*VotePollResponse, error)

type VotePollResponse

type VotePollResponse struct {
	Options []model.PollOption `json:"options"`
}

Source Files

Jump to

Keyboard shortcuts

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