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

Add code block type

This commit is contained in:
David Stotijn
2021-12-16 12:57:03 +01:00
parent 0060b295c2
commit e9dfe659c0

View File

@ -26,6 +26,7 @@ type Block struct {
ChildPage *ChildPage `json:"child_page,omitempty"` ChildPage *ChildPage `json:"child_page,omitempty"`
Callout *Callout `json:"callout,omitempty"` Callout *Callout `json:"callout,omitempty"`
Quote *RichTextBlock `json:"quote,omitempty"` Quote *RichTextBlock `json:"quote,omitempty"`
Code *Code `json:"code,omitempty"`
} }
type RichTextBlock struct { type RichTextBlock struct {
@ -51,6 +52,11 @@ type Callout struct {
Icon *Icon `json:"icon,omitempty"` Icon *Icon `json:"icon,omitempty"`
} }
type Code struct {
RichTextBlock
Language *string `json:"language,omitempty"`
}
type BlockType string type BlockType string
const ( const (
@ -65,6 +71,7 @@ const (
BlockTypeChildPage BlockType = "child_page" BlockTypeChildPage BlockType = "child_page"
BlockTypeCallout BlockType = "callout" BlockTypeCallout BlockType = "callout"
BlockTypeQuote BlockType = "quote" BlockTypeQuote BlockType = "quote"
BlockTypeCode BlockType = "code"
BlockTypeUnsupported BlockType = "unsupported" BlockTypeUnsupported BlockType = "unsupported"
) )