1
0
mirror of https://github.com/dstotijn/go-notion.git synced 2025-06-10 23:47:33 +02:00

Add support for template mentions in RichText values (#32)

This commit is contained in:
David Stotijn 2022-08-14 11:15:15 +02:00 committed by GitHub
parent 51efbea8fd
commit 8519feef2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,6 +32,7 @@ type Mention struct {
Database *ID `json:"database,omitempty"`
Date *Date `json:"date,omitempty"`
LinkPreview *LinkPreview `json:"link_preview,omitempty"`
TemplateMention *TemplateMention `json:"template_mention,omitempty"`
}
type Date struct {
@ -44,6 +45,13 @@ type LinkPreview struct {
URL string `json:"url"`
}
type TemplateMention struct {
Type TemplateMentionType `json:"type"`
TemplateMentionDate *TemplateMentionDateType `json:"template_mention_date,omitempty"`
TemplateMentionUser *TemplateMentionUserType `json:"template_mention_user,omitempty"`
}
type Text struct {
Content string `json:"content"`
Link *Link `json:"link,omitempty"`
@ -60,6 +68,9 @@ type ID struct {
type (
RichTextType string
MentionType string
TemplateMentionType string
TemplateMentionDateType string
TemplateMentionUserType string
Color string
)
@ -75,6 +86,13 @@ const (
MentionTypeDatabase MentionType = "database"
MentionTypeDate MentionType = "date"
MentionTypeLinkPreview MentionType = "link_preview"
MentionTypeTemplateMention MentionType = "template_mention"
TemplateMentionTypeDate TemplateMentionType = "template_mention_date"
TemplateMentionTypeUser TemplateMentionType = "template_mention_user"
TemplateMentionDateTypeToday TemplateMentionDateType = "today"
TemplateMentionDateTypeNow TemplateMentionDateType = "now"
TemplateMentionUserTypeMe TemplateMentionUserType = "me"
)
const (