1
0
mirror of https://github.com/dstotijn/go-notion.git synced 2025-06-27 00:41:07 +02:00

Add support for link_preview block type and rich text mentions

This commit is contained in:
David Stotijn
2021-12-17 13:14:55 +01:00
parent 1ee9d231ed
commit 8e676e0df8
2 changed files with 16 additions and 8 deletions

View File

@ -40,6 +40,7 @@ type Block struct {
Breadcrumb *Breadcrumb `json:"breadcrumb,omitempty"`
ColumnList *ColumnList `json:"column_list,omitempty"`
Column *Column `json:"column,omitempty"`
LinkPreview *LinkPreview `json:"link_preview,omitempty"`
}
type RichTextBlock struct {
@ -149,6 +150,7 @@ const (
BlockTypeBreadCrumb BlockType = "breadcrumb"
BlockTypeColumnList BlockType = "column_list"
BlockTypeColumn BlockType = "column"
BlockTypeLinkPreview BlockType = "link_preview"
BlockTypeUnsupported BlockType = "unsupported"
)

View File

@ -31,6 +31,7 @@ type Mention struct {
Page *ID `json:"page,omitempty"`
Database *ID `json:"database,omitempty"`
Date *Date `json:"date,omitempty"`
LinkPreview *LinkPreview `json:"link_preview,omitempty"`
}
type Date struct {
@ -38,6 +39,10 @@ type Date struct {
End *DateTime `json:"end,omitempty"`
}
type LinkPreview struct {
URL string `json:"url"`
}
type Text struct {
Content string `json:"content"`
Link *Link `json:"link,omitempty"`
@ -68,6 +73,7 @@ const (
MentionTypePage MentionType = "page"
MentionTypeDatabase MentionType = "database"
MentionTypeDate MentionType = "date"
MentionTypeLinkPreview MentionType = "link_preview"
)
const (