mirror of
https://github.com/dstotijn/go-notion.git
synced 2025-06-29 00:41:34 +02:00
Add support for link_preview
block type and rich text mentions
This commit is contained in:
2
block.go
2
block.go
@ -40,6 +40,7 @@ type Block struct {
|
|||||||
Breadcrumb *Breadcrumb `json:"breadcrumb,omitempty"`
|
Breadcrumb *Breadcrumb `json:"breadcrumb,omitempty"`
|
||||||
ColumnList *ColumnList `json:"column_list,omitempty"`
|
ColumnList *ColumnList `json:"column_list,omitempty"`
|
||||||
Column *Column `json:"column,omitempty"`
|
Column *Column `json:"column,omitempty"`
|
||||||
|
LinkPreview *LinkPreview `json:"link_preview,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RichTextBlock struct {
|
type RichTextBlock struct {
|
||||||
@ -149,6 +150,7 @@ const (
|
|||||||
BlockTypeBreadCrumb BlockType = "breadcrumb"
|
BlockTypeBreadCrumb BlockType = "breadcrumb"
|
||||||
BlockTypeColumnList BlockType = "column_list"
|
BlockTypeColumnList BlockType = "column_list"
|
||||||
BlockTypeColumn BlockType = "column"
|
BlockTypeColumn BlockType = "column"
|
||||||
|
BlockTypeLinkPreview BlockType = "link_preview"
|
||||||
BlockTypeUnsupported BlockType = "unsupported"
|
BlockTypeUnsupported BlockType = "unsupported"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ type Mention struct {
|
|||||||
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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Date struct {
|
type Date struct {
|
||||||
@ -38,6 +39,10 @@ type Date struct {
|
|||||||
End *DateTime `json:"end,omitempty"`
|
End *DateTime `json:"end,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type LinkPreview struct {
|
||||||
|
URL string `json:"url"`
|
||||||
|
}
|
||||||
|
|
||||||
type Text struct {
|
type Text struct {
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
Link *Link `json:"link,omitempty"`
|
Link *Link `json:"link,omitempty"`
|
||||||
@ -68,6 +73,7 @@ const (
|
|||||||
MentionTypePage MentionType = "page"
|
MentionTypePage MentionType = "page"
|
||||||
MentionTypeDatabase MentionType = "database"
|
MentionTypeDatabase MentionType = "database"
|
||||||
MentionTypeDate MentionType = "date"
|
MentionTypeDate MentionType = "date"
|
||||||
|
MentionTypeLinkPreview MentionType = "link_preview"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
Reference in New Issue
Block a user