mirror of
https://github.com/dstotijn/go-notion.git
synced 2025-06-12 23:57:35 +02:00
Add support for template mentions in RichText values (#32)
This commit is contained in:
parent
51efbea8fd
commit
8519feef2f
44
rich_text.go
44
rich_text.go
@ -27,11 +27,12 @@ type Annotations struct {
|
|||||||
type Mention struct {
|
type Mention struct {
|
||||||
Type MentionType `json:"type"`
|
Type MentionType `json:"type"`
|
||||||
|
|
||||||
User *User `json:"user,omitempty"`
|
User *User `json:"user,omitempty"`
|
||||||
Page *ID `json:"page,omitempty"`
|
Page *ID `json:"page,omitempty"`
|
||||||
Database *ID `json:"database,omitempty"`
|
Database *ID `json:"database,omitempty"`
|
||||||
Date *Date `json:"date,omitempty"`
|
Date *Date `json:"date,omitempty"`
|
||||||
LinkPreview *LinkPreview `json:"link_preview,omitempty"`
|
LinkPreview *LinkPreview `json:"link_preview,omitempty"`
|
||||||
|
TemplateMention *TemplateMention `json:"template_mention,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Date struct {
|
type Date struct {
|
||||||
@ -44,6 +45,13 @@ type LinkPreview struct {
|
|||||||
URL string `json:"url"`
|
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 {
|
type Text struct {
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
Link *Link `json:"link,omitempty"`
|
Link *Link `json:"link,omitempty"`
|
||||||
@ -58,9 +66,12 @@ type ID struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type (
|
type (
|
||||||
RichTextType string
|
RichTextType string
|
||||||
MentionType string
|
MentionType string
|
||||||
Color string
|
TemplateMentionType string
|
||||||
|
TemplateMentionDateType string
|
||||||
|
TemplateMentionUserType string
|
||||||
|
Color string
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -70,11 +81,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MentionTypeUser MentionType = "user"
|
MentionTypeUser MentionType = "user"
|
||||||
MentionTypePage MentionType = "page"
|
MentionTypePage MentionType = "page"
|
||||||
MentionTypeDatabase MentionType = "database"
|
MentionTypeDatabase MentionType = "database"
|
||||||
MentionTypeDate MentionType = "date"
|
MentionTypeDate MentionType = "date"
|
||||||
MentionTypeLinkPreview MentionType = "link_preview"
|
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 (
|
const (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user