v1

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIVersion = "v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access struct {
	Unopened int `json:"unopened"`
}

type Account

type Account struct {
	ID             int        `json:"id"`
	Name           string     `json:"name"`
	FullName       string     `json:"fullName"`
	Suggestion     string     `json:"suggestion"`
	ImageURL       string     `json:"imageUrl"`
	IsBot          bool       `json:"isBot"`
	Lang           string     `json:"lang"`
	TimezoneID     string     `json:"timezoneId"`
	CreatedAt      *time.Time `json:"createdAt"`
	UpdatedAt      *time.Time `json:"updatedAt"`
	ImageUpdatedAt *time.Time `json:"imageUpdatedAt"`
}

Account represents Typetalk account information.

type AccountStatus

type AccountStatus struct {
	Account *Account `json:"account"`
	Status  *Status  `json:"status"`
}

AccountStatus contains account and status information.

type AccountsService

type AccountsService service

AccountsService handles communication with the account related API.

func (*AccountsService) GetFriendProfile

func (s *AccountsService) GetFriendProfile(ctx context.Context, accountName string) (*Profile, *shared.Response, error)

GetFriendProfile fetches other user's account information.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-friend-profile

func (*AccountsService) GetMyFriends deprecated

GetMyFriends searches other user who belong to a topic in common.

Deprecated: Use GetMyFrieands in github.com/nulab/go-typetalk/typetalk/v4

func (*AccountsService) GetMyProfile

func (s *AccountsService) GetMyProfile(ctx context.Context) (*MyProfile, *shared.Response, error)

GetMyProfile fetches the user's account information.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-profile

func (*AccountsService) GetOnlineStatus

func (s *AccountsService) GetOnlineStatus(ctx context.Context, accountIds ...int) (*OnlineStatus, *shared.Response, error)

GetOnlineStatus fetches an user's online status.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-online-status

func (*AccountsService) SearchAccounts deprecated

func (s *AccountsService) SearchAccounts(ctx context.Context, nameOrEmailAddress string) (*Account, *shared.Response, error)

SearchAccounts searches acocunts by name or mail address.

Deprecated: Use GetMyFrieands in github.com/nulab/go-typetalk/typetalk/v4

type AttachmentFile

type AttachmentFile struct {
	ContentType string `json:"contentType"`
	FileKey     string `json:"fileKey"`
	FileName    string `json:"fileName"`
	FileSize    int    `json:"fileSize"`
}

type Bookmark

type Bookmark struct {
	PostID    int       `json:"postId"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type Client

type Client struct {
	Accounts      *AccountsService
	Files         *FilesService
	Mentions      *MentionsService
	Messages      *MessagesService
	Notifications *NotificationsService
	Organizations *OrganizationsService
	Talks         *TalksService
	Topics        *TopicsService
	Likes         *LikesService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient *http.Client) *Client

func (*Client) SetTypetalkToken

func (c *Client) SetTypetalkToken(token string) *Client

type CreateTalkOptions

type CreateTalkOptions struct {
	TalkName string `json:"talkName"`
	PostIds  []int  `json:"postIds[%d],omitempty"`
}

type CreateTopicOptions

type CreateTopicOptions struct {
	Name          string `json:"name,omitempty"`
	SpaceKey      string `json:"spaceKey,omitempty"`
	AddAccountIds []int  `json:"addAccountIds[%d],omitempty"`
	AddGroupIds   []int  `json:"addGroupIds[%d],omitempty"`
}

type CreatedTalkResult

type CreatedTalkResult struct {
	Topic   *Topic `json:"topic"`
	Talk    *Talk  `json:"talk"`
	PostIds []int  `json:"postIds"`
}

type DeletedTalkResult

type DeletedTalkResult CreatedTalkResult

type DirectMessage

type DirectMessage AccountStatus

type DirectMessageTopic

type DirectMessageTopic struct {
	Topic         *Topic         `json:"topic"`
	Unread        *Unread        `json:"unread"`
	DirectMessage *DirectMessage `json:"directMessage"`
}

type DirectMessages

type DirectMessages struct {
	Topic         *Topic         `json:"topic"`
	DirectMessage *DirectMessage `json:"directMessage"`
	Bookmark      *Bookmark      `json:"bookmark"`
	Posts         []*Post        `json:"posts"`
	HasNext       bool           `json:"hasNext"`
}

type DiscoverLikedPost

type DiscoverLikedPost struct {
	*LikedPost
}

type FavoriteTopic

type FavoriteTopic struct {
	Topic    *Topic `json:"topic"`
	Favorite bool   `json:"favorite"`
}

type FavoriteTopicWithUnread

type FavoriteTopicWithUnread struct {
	FavoriteTopic
	Unread Unread `json:"unread"`
}

type FilesService

type FilesService service

func (*FilesService) DownloadAttachmentFile

func (s *FilesService) DownloadAttachmentFile(ctx context.Context, topicID, postID, attachmentID int, filename string) (io.ReadCloser, error)

DownloadAttachmentFile downloads attachment file.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/download-attachment

func (*FilesService) UploadAttachmentFile

func (s *FilesService) UploadAttachmentFile(ctx context.Context, topicID int, file *os.File) (*AttachmentFile, *shared.Response, error)

UploadAttachmentFile uploads attachment file.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/upload-attachment

type Friends

type Friends struct {
	Count    int              `json:"count"`
	Accounts []*AccountStatus `json:"accounts"`
}

Friends represents accounts search result.

type GetLikesOptions

type GetLikesOptions struct {
	From int `json:"from,omitempty"`
}

type GetMentionListOptions

type GetMentionListOptions struct {
	From   int  `json:"from,omitempty"`
	Unread bool `json:"unread,omitempty"`
}

type GetMessagesOptions

type GetMessagesOptions struct {
	Count     int    `json:"count,omitempty"`
	From      int    `json:"from,omitempty"`
	Direction string `json:"direction,omitempty"`
}

type GetMyFriendsOptions

type GetMyFriendsOptions struct {
	Q      string `json:"q,omitempty"`
	Offset int    `json:"offset,omitempty"`
	Count  int    `json:"count,omitempty"`
}

GetMyFriendsOptions represents request parameters for "search/friends" API.

type GetTopicMessagesOptions

type GetTopicMessagesOptions struct {
	Count     int    `json:"count,omitempty"`
	From      int    `json:"from,omitempty"`
	Direction string `json:"direction,omitempty"`
}

type GiveLikedPost

type GiveLikedPost struct {
	*ReceiveLikedPost
	MyLike *MyLike `json:"myLike"`
}

type Group

type Group struct {
	ID         int        `json:"id"`
	Key        string     `json:"key"`
	Name       string     `json:"name"`
	Suggestion string     `json:"suggestion"`
	ImageURL   string     `json:"imageUrl"`
	CreatedAt  *time.Time `json:"createdAt"`
	UpdatedAt  *time.Time `json:"updatedAt"`
}

type Invites

type Invites struct {
	Teams  []interface{} `json:"teams"`
	Topics []*Topic      `json:"topics"`
}

type Like

type Like struct {
	ID        int        `json:"id"`
	PostID    int        `json:"postId"`
	TopicID   int        `json:"topicId"`
	Comment   string     `json:"comment"`
	Account   *Account   `json:"account"`
	CreatedAt *time.Time `json:"createdAt"`
}

type LikedMessageResult

type LikedMessageResult struct {
	Like          *Like          `json:"like"`
	Post          *Post          `json:"post"`
	Topic         *Topic         `json:"topic"`
	DirectMessage *DirectMessage `json:"directMessage"`
}

type LikedPost

type LikedPost struct {
	Post          *Post          `json:"post"`
	Likes         []*Like        `json:"likes"`
	DirectMessage *DirectMessage `json:"directMessage"`
}

type LikesService

type LikesService service

func (*LikesService) GetLikesDiscover

func (s *LikesService) GetLikesDiscover(ctx context.Context, opt *GetLikesOptions) ([]*DiscoverLikedPost, *shared.Response, error)

GetLikesDiscover fetches given likes list. Those likes are given by all the accounts.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-likes-discover/

func (*LikesService) GetLikesGive

func (s *LikesService) GetLikesGive(ctx context.Context, opt *GetLikesOptions) ([]*GiveLikedPost, *shared.Response, error)

GetLikesGive fetches given likes list. Those likes are given by your account.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-likes-give/

func (*LikesService) GetLikesReceive

func (s *LikesService) GetLikesReceive(ctx context.Context, opt *GetLikesOptions) ([]*ReceiveLikedPost, *shared.Response, error)

GetLikesReceive fetches received likes list.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-likes-receive/

func (*LikesService) ReadReceivedLikes

func (s *LikesService) ReadReceivedLikes(ctx context.Context, likeID int) (*ReadReceivedLikesResult, *shared.Response, error)

ReadReceivedLikes marks likes as read.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/save-read-likes/

type Mention

type Mention struct {
	ID     int        `json:"id"`
	ReadAt *time.Time `json:"readAt"`
	Post   *Post      `json:"post"`
}

type MentionsService

type MentionsService service

func (*MentionsService) GetMentionList

func (s *MentionsService) GetMentionList(ctx context.Context, opt *GetMentionListOptions) ([]*Mention, *shared.Response, error)

GetMentionList fetches mentions list.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-mentions

func (*MentionsService) ReadMention

func (s *MentionsService) ReadMention(ctx context.Context, mentionID int) (*Mention, *shared.Response, error)

ReadMention marks a mention as read.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/save-read-mention

type Message

type Message struct {
	MySpace                *Organization `json:"mySpace"`
	Team                   interface{}   `json:"team"`
	Topic                  *Topic        `json:"topic"`
	Post                   *Post         `json:"post"`
	Replies                []*Post       `json:"replies"`
	ExceedsAttachmentLimit bool          `json:"exceedsAttachmentLimit"`
}

type MessagesInTalk

type MessagesInTalk struct {
	MySpace       *Organization  `json:"mySpace"`
	Topic         *Topic         `json:"topic"`
	DirectMessage *DirectMessage `json:"directMessage"`
	Talk          *Talk          `json:"talk"`
	Posts         []*Post        `json:"posts"`
	HasNext       bool           `json:"hasNext"`
}

type MessagesService

type MessagesService service

func (*MessagesService) DeleteMessage

func (s *MessagesService) DeleteMessage(ctx context.Context, topicID, postID int) (*Post, *shared.Response, error)

DeleteMessage deletes a message.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/delete-message

func (*MessagesService) GetDirectMessages deprecated

func (s *MessagesService) GetDirectMessages(ctx context.Context, accountName string, opt *GetMessagesOptions) (*DirectMessages, *shared.Response, error)

GetDirectMessages fetches direct messages list.

Deprecated: Use GetDirectMessages in github.com/nulab/go-typetalk/typetalk/v2

func (*MessagesService) GetMessage

func (s *MessagesService) GetMessage(ctx context.Context, topicID, postID int) (*Message, *shared.Response, error)

GetMessage gets a message.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-message

func (*MessagesService) GetMyDirectMessageTopics deprecated

func (s *MessagesService) GetMyDirectMessageTopics(ctx context.Context) ([]*DirectMessageTopic, *shared.Response, error)

GetMyDirectMessageTopics fetches direct message topics list.

Deprecated: Use GetMyDirectMessageTopics in github.com/nulab/go-typetalk/typetalk/v2

func (*MessagesService) LikeMessage

func (s *MessagesService) LikeMessage(ctx context.Context, topicID, postID int) (*LikedMessageResult, *shared.Response, error)

LikeMessage marks a message as liked.

Typetalk API docs: https://developer.nulab-inc.com/ja/docs/typetalk/api/1/favorite-topic

func (*MessagesService) PostDirectMessage deprecated

func (s *MessagesService) PostDirectMessage(ctx context.Context, accountName, message string, opt *PostMessageOptions) (*PostedMessageResult, *shared.Response, error)

PostDirectMessage posts direct message.

Deprecated: Use PostDirectMessage in github.com/nulab/go-typetalk/typetalk/v2

func (*MessagesService) PostMessage

func (s *MessagesService) PostMessage(ctx context.Context, topicID int, message string, opt *PostMessageOptions) (*PostedMessageResult, *shared.Response, error)

PostMessage posts a message.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/post-message

func (*MessagesService) UnlikeMessage

func (s *MessagesService) UnlikeMessage(ctx context.Context, topicID, postID int) (*Like, *shared.Response, error)

UnlikeMessage marks a message as unliked.

Typetalk API docs: https://developer.nulab-inc.com/ja/docs/typetalk/api/1/unfavorite-topic

func (*MessagesService) UpdateMessage

func (s *MessagesService) UpdateMessage(ctx context.Context, topicID, postID int, message string) (*UpdatedMessageResult, *shared.Response, error)

UpdateMessage updates a message.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/update-message

type MyLike

type MyLike struct {
	ID        int       `json:"id"`
	Comment   string    `json:"comment"`
	CreatedAt time.Time `json:"createdAt"`
}

type MyPlan

type MyPlan struct {
	Plan                *Plan       `json:"plan"`
	Enabled             bool        `json:"enabled"`
	Trial               interface{} `json:"trial"`
	NumberOfUsers       int         `json:"numberOfUsers"`
	TotalAttachmentSize int         `json:"totalAttachmentSize"`
	CreatedAt           *time.Time  `json:"createdAt"`
	UpdatedAt           *time.Time  `json:"updatedAt"`
}

type MyProfile

type MyProfile struct {
	Account *Account `json:"account"`
	Lang    string   `json:"lang"`
	Theme   string   `json:"theme"`
	Post    *struct {
		UseCtrl       bool   `json:"useCtrl"`
		EmojiSkinTone string `json:"emojiSkinTone"`
	} `json:"post"`
}

MyProfile represents the user's information.

type NotificationCount

type NotificationCount struct {
	Mention *struct {
		Unread int `json:"unread"`
	} `json:"mention"`
	Access *Access `json:"access"`
	Invite *struct {
		Team *struct {
			Pending int `json:"pending"`
		} `json:"team"`
		Topic *struct {
			Pending int `json:"pending"`
		} `json:"topic"`
	} `json:"invite"`
	Like *struct {
		Receive interface{} `json:"receive"`
	} `json:"like"`
	DirectMessage *struct {
		UnreadTopics int `json:"unreadTopics"`
	} `json:"directMessage"`
}

type NotificationList

type NotificationList struct {
	Mentions []*Mention `json:"mentions"`
	Invites  *Invites   `json:"invites"`
}

type NotificationsService

type NotificationsService service

func (*NotificationsService) GetNotificationCount

func (s *NotificationsService) GetNotificationCount(ctx context.Context) (*NotificationCount, *shared.Response, error)

GetNotificationCount fetches notification counts.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-notification-status

func (*NotificationsService) GetNotificationList

func (s *NotificationsService) GetNotificationList(ctx context.Context) (*NotificationList, *shared.Response, error)

GetNotificationList fetches notifications list.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-notifications

func (*NotificationsService) ReadNotification deprecated

func (s *NotificationsService) ReadNotification(ctx context.Context) (*Access, *shared.Response, error)

ReadNotification marks notifications as read.

Deprecated: Use ReadNotification in github.com/nulab/go-typetalk/typetalk/v3

type OnlineStatus

type OnlineStatus struct {
	Accounts []*AccountStatus `json:"accounts"`
}

OnlineStatus contains accounts information.

type Organization

type Organization struct {
	Space          *Space  `json:"space"`
	MyRole         string  `json:"myRole"`
	IsPaymentAdmin bool    `json:"isPaymentAdmin"`
	MyPlan         *MyPlan `json:"myPlan"`
}

type OrganizationMembers

type OrganizationMembers struct {
	Accounts []*Account `json:"accounts"`
	Groups   []*struct {
		Group       *Group `json:"group"`
		MemberCount int    `json:"memberCount"`
	} `json:"groups"`
}

type OrganizationsService

type OrganizationsService service

func (*OrganizationsService) GetMyOrganizations

func (s *OrganizationsService) GetMyOrganizations(ctx context.Context, excludesGuest bool) ([]*Organization, *shared.Response, error)

GetMyOrganizations fetches organizations list.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-spaces

func (*OrganizationsService) GetOrganizationMembers

func (s *OrganizationsService) GetOrganizationMembers(ctx context.Context, spaceKey string) (*OrganizationMembers, *shared.Response, error)

GetOrganizationMembers fetches an organization's members list.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-space-members

type Plan

type Plan struct {
	Key                      string `json:"key"`
	Name                     string `json:"name"`
	LimitNumberOfUsers       int    `json:"limitNumberOfUsers"`
	LimitTotalAttachmentSize int    `json:"limitTotalAttachmentSize"`
}

type Post

type Post struct {
	ID          int               `json:"id"`
	TopicID     int               `json:"topicId"`
	ReplyTo     int               `json:"replyTo"`
	Message     string            `json:"message"`
	Account     *Account          `json:"account"`
	Mention     *Mention          `json:"mention"`
	Attachments []*AttachmentFile `json:"attachments"`
	Likes       []*Like           `json:"likes"`
	Talks       []*Talk           `json:"talks"`
	Links       []interface{}     `json:"links"`
	CreatedAt   *time.Time        `json:"createdAt"`
	UpdatedAt   *time.Time        `json:"updatedAt"`
}

type PostMessageOptions

type PostMessageOptions struct {
	ReplyTo      int      `json:"replyTo,omitempty"`
	ShowLinkMeta bool     `json:"showLinkMeta,omitempty"`
	FileKeys     []string `json:"fileKeys[%d],omitempty"`
	TalkIds      []int    `json:"talkIds[%d],omitempty"`
	FileUrls     []string `json:"attachments[%d].fileUrl,omitempty"`
	FileNames    []string `json:"attachments[%d].fileName,omitempty"`
}

type PostedMessageResult

type PostedMessageResult struct {
	Space                  *Space         `json:"space"`
	Topic                  *Topic         `json:"topic"`
	Post                   *Post          `json:"post"`
	Mentions               []*Mention     `json:"mentions"`
	ExceedsAttachmentLimit bool           `json:"exceedsAttachmentLimit"`
	DirectMessage          *DirectMessage `json:"directMessage"`
}

type Profile

type Profile AccountStatus

Profile is alias for AccountStatus.

type ReadReceivedLikesResult

type ReadReceivedLikesResult struct {
	Like struct {
		Receive struct {
			HasUnread  bool `json:"hasUnread"`
			ReadLikeID int  `json:"readLikeId"`
		} `json:"receive"`
	} `json:"like"`
}

type ReceiveLikedPost

type ReceiveLikedPost struct {
	*LikedPost
}

type RemovedMessagesResult

type RemovedMessagesResult CreatedTalkResult

type Space

type Space struct {
	Key      string `json:"key"`
	Name     string `json:"name"`
	Enabled  bool   `json:"enabled"`
	ImageURL string `json:"imageUrl"`
}

type Status

type Status struct {
	Presence *string     `json:"presence"`
	Web      interface{} `json:"web"`
	Mobile   interface{} `json:"mobile"`
}

Status represents online status of the user.

type Talk

type Talk struct {
	ID         int         `json:"id"`
	TopicID    int         `json:"topicId"`
	Name       string      `json:"name"`
	Suggestion string      `json:"suggestion"`
	CreatedAt  *time.Time  `json:"createdAt"`
	UpdatedAt  *time.Time  `json:"updatedAt"`
	Backlog    interface{} `json:"backlog"`
}

type TalksService

type TalksService service

func (*TalksService) AddMessagesToTalk

func (s *TalksService) AddMessagesToTalk(ctx context.Context, topicID, talkID int, postIds ...int) (*MessagesInTalk, *shared.Response, error)

AddMessagesToTalk adds messages to a talk.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/add-message-to-talk

func (*TalksService) CreateTalk

func (s *TalksService) CreateTalk(ctx context.Context, topicID int, talkName string, postIds ...int) (*CreatedTalkResult, *shared.Response, error)

CreateTalk creates a talk.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/create-talk

func (*TalksService) DeleteTalk

func (s *TalksService) DeleteTalk(ctx context.Context, topicID, talkID int) (*DeletedTalkResult, *shared.Response, error)

DeleteTalk deletes a talk.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/delete-talk

func (*TalksService) GetMessagesInTalk

func (s *TalksService) GetMessagesInTalk(ctx context.Context, topicID, talkID int, opt *GetMessagesOptions) (*MessagesInTalk, *shared.Response, error)

GetMessagesInTalk fetches messages list in a talk.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-talk

func (*TalksService) GetTalkList

func (s *TalksService) GetTalkList(ctx context.Context, topicID int) ([]*Talk, *shared.Response, error)

GetTalkList fetches talks list.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-talks

func (*TalksService) RemoveMessagesFromTalk

func (s *TalksService) RemoveMessagesFromTalk(ctx context.Context, topicID, talkID int, postIds ...int) (*RemovedMessagesResult, *shared.Response, error)

RemoveMessagesFromTalk removes messages from a talk.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/remove-message-from-talk

func (*TalksService) UpdateTalk

func (s *TalksService) UpdateTalk(ctx context.Context, topicID, talkID int, talkName string) (*UpdatedTalkResult, *shared.Response, error)

UpdateTalk updates a talk.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/update-talk

type Topic

type Topic struct {
	ID              int        `json:"id"`
	Name            string     `json:"name"`
	Description     string     `json:"description"`
	Suggestion      string     `json:"suggestion"`
	IsDirectMessage bool       `json:"isDirectMessage"`
	LastPostedAt    *time.Time `json:"lastPostedAt"`
	CreatedAt       *time.Time `json:"createdAt"`
	UpdatedAt       *time.Time `json:"updatedAt"`
}

type TopicDetails

type TopicDetails struct {
	Topic   *Topic        `json:"topic"`
	MySpace *Organization `json:"mySpace"`
	Teams   []interface{} `json:"teams"`
	Groups  []*struct {
		Group       *Group `json:"group"`
		MemberCount int    `json:"memberCount"`
	} `json:"groups"`
	Accounts             []*Account    `json:"accounts"`
	InvitingAccounts     []interface{} `json:"invitingAccounts"`
	Invites              []interface{} `json:"invites"`
	AccountsForAPI       []interface{} `json:"accountsForApi"`
	Integrations         []interface{} `json:"integrations"`
	RemainingInvitations interface{}   `json:"remainingInvitations"`
}

type TopicMessages

type TopicMessages struct {
	MySpace                *Organization `json:"mySpace"`
	Team                   interface{}   `json:"team"`
	Topic                  *Topic        `json:"topic"`
	Bookmark               *Bookmark     `json:"bookmark"`
	Posts                  []*Post       `json:"posts"`
	HasNext                bool          `json:"hasNext"`
	ExceedsAttachmentLimit bool          `json:"exceedsAttachmentLimit"`
}

type TopicsService

type TopicsService service

func (*TopicsService) CreateTopic

CreateTopic creates a topic.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/create-topic

func (*TopicsService) DeleteTopic

func (s *TopicsService) DeleteTopic(ctx context.Context, topicID int) (*Topic, *shared.Response, error)

DeleteTopic deletes a topic.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/delete-topic

func (*TopicsService) FavoriteTopic

func (s *TopicsService) FavoriteTopic(ctx context.Context, topicID int) (*FavoriteTopic, *shared.Response, error)

FavoriteTopic marks a topic as favorite.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/favorite-topic

func (*TopicsService) GetMyTopics

GetMyTopics fetches topics list.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-topics

func (*TopicsService) GetTopicDetails

func (s *TopicsService) GetTopicDetails(ctx context.Context, topicID int) (*TopicDetails, *shared.Response, error)

GetTopicDetails fetches a topic's detailed information.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-topic-details

func (*TopicsService) GetTopicMessages

func (s *TopicsService) GetTopicMessages(ctx context.Context, topicID int, opt *GetTopicMessagesOptions) (*TopicMessages, *shared.Response, error)

GetTopicMessages fetches messages list in a topic.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/get-messages

func (*TopicsService) ReadMessagesInTopic

func (s *TopicsService) ReadMessagesInTopic(ctx context.Context, topicID, postID int) (*Unread, *shared.Response, error)

ReadMessagesInTopic mark a message as read.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/save-read-topic

func (*TopicsService) UnfavoriteTopic

func (s *TopicsService) UnfavoriteTopic(ctx context.Context, topicID int) (*FavoriteTopic, *shared.Response, error)

UnfavoriteTopic marks a topic as unfavorite.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/unfavorite-topic

func (*TopicsService) UpdateTopic

func (s *TopicsService) UpdateTopic(ctx context.Context, topicID int, opt *UpdateTopicOptions) (*TopicDetails, *shared.Response, error)

UpdateTopic updates a topic.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/update-topic

func (*TopicsService) UpdateTopicMembers

func (s *TopicsService) UpdateTopicMembers(ctx context.Context, topicID int, opt *UpdateTopicMembersOptions) (*TopicDetails, *shared.Response, error)

UpdateTopicMembers updates members in a topic.

Typetalk API docs: https://developer.nulab-inc.com/docs/typetalk/api/1/update-topic-members

type Unread

type Unread struct {
	TopicID int `json:"topicId"`
	PostID  int `json:"postId"`
	Count   int `json:"count"`
}

type UpdateTopicMembersOptions

type UpdateTopicMembersOptions struct {
	AddAccountIds                       []int    `json:"addAccountIds[%d],omitempty"`
	AddGroupIds                         []int    `json:"addGroupIds[%d],omitempty"`
	InvitationsEmail                    []string `json:"invitations[%d].email,omitempty"`
	InvitationsRole                     []string `json:"invitations[%d].role,omitempty"`
	RemoveAccountsID                    []int    `json:"removeAccounts[%d].id,omitempty"`
	RemoveAccountsCancelSpaceInvitation []bool   `json:"removeAccounts[%d].cancelSpaceInvitation,omitempty"`
	RemoveGroupIds                      []bool   `json:"removeGroupIds[%d],omitempty"`
}

type UpdateTopicOptions

type UpdateTopicOptions struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type UpdatedMessageResult

type UpdatedMessageResult PostedMessageResult

type UpdatedTalkResult

type UpdatedTalkResult struct {
	Topic *Topic `json:"topic"`
	Talk  *Talk  `json:"talk"`
}

Jump to

Keyboard shortcuts

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