Documentation
¶
Overview ¶
Package notion provides a client for the Notion API.
Index ¶
- Constants
- func IsPermanentError(err error) bool
- func NormalizeID(id string) string
- func PageIDFromContext(ctx context.Context) string
- func ParsePageIDOrURL(input string) (string, error)
- func ParseRichText(richText []RichText) string
- func ParseRichTextToMarkdown(richText []RichText) string
- func WithPageID(ctx context.Context, pageID string) context.Context
- type APIError
- type Annotations
- type Block
- type BlockChildrenResponse
- type BlockFetchResult
- type BookmarkBlock
- type Bot
- type BotInfo
- type BotOwner
- type CalloutBlock
- type ChildDatabaseBlock
- type ChildPageBlock
- type Client
- func (c *Client) GetAllBlockChildren(ctx context.Context, blockID string, _ int) ([]Block, error)
- func (c *Client) GetAllBlockChildrenWithLimit(ctx context.Context, blockID string, maxDepth int) (BlockFetchResult, error)
- func (c *Client) GetBlock(ctx context.Context, blockID string) (*Block, error)
- func (c *Client) GetBlockChildren(ctx context.Context, blockID string, cursor string) (*BlockChildrenResponse, error)
- func (c *Client) GetDataSource(ctx context.Context, dataSourceID string) (*DataSource, error)
- func (c *Client) GetDatabase(ctx context.Context, databaseID string) (*Database, error)
- func (c *Client) GetDatabaseContainer(ctx context.Context, databaseID string) (*DatabaseContainer, error)
- func (c *Client) GetMe(ctx context.Context) (*Bot, error)
- func (c *Client) GetPage(ctx context.Context, pageID string) (*Page, error)
- func (c *Client) GetUser(ctx context.Context, userID string) (*User, error)
- func (c *Client) QueryDataSource(ctx context.Context, dataSourceID string) ([]DatabasePage, error)
- func (c *Client) QueryDatabase(ctx context.Context, databaseID string) ([]DatabasePage, error)
- func (c *Client) Search(ctx context.Context, filter SearchFilter) (*SearchResponse, error)
- func (c *Client) SearchAllPages(ctx context.Context) ([]Page, error)
- func (c *Client) SearchAllPagesWithStop(ctx context.Context, shouldStop func([]Page) bool) ([]Page, error)
- func (c *Client) SearchWorkspacePages(ctx context.Context) ([]Page, error)
- type ClientOption
- type CodeBlock
- type ColumnBlock
- type ColumnListBlock
- type DataSource
- type DataSourceInfo
- type Database
- type DatabaseContainer
- type DatabasePage
- type DateProperty
- type DividerBlock
- type EmbedBlock
- type Equation
- type EquationBlock
- type ExternalFile
- type File
- type FileBlock
- type FileObject
- type FormulaValue
- type HeadingBlock
- type Icon
- type Link
- type LinkToPageBlock
- type ListItemBlock
- type Mention
- type Page
- type ParagraphBlock
- type Parent
- type Person
- type Properties
- type Property
- type QueryDatabaseResponse
- type QuoteBlock
- type RelationItem
- type RichText
- type RollupValue
- type SearchFilter
- type SearchResponse
- type SelectOption
- type SyncedBlockBlock
- type SyncedFrom
- type TableBlock
- type TableOfContentsBlock
- type TableRowBlock
- type TextContent
- type ToDoBlock
- type ToggleBlock
- type UniqueIDValue
- type User
- type VerificationValue
Constants ¶
const ( // BaseURL is the Notion API base URL. BaseURL = "https://api.notion.com/v1" // APIVersion is the Notion API version to use. APIVersion = "2025-09-03" )
Variables ¶
This section is empty.
Functions ¶
func IsPermanentError ¶ added in v0.6.2
IsPermanentError checks if an error (possibly wrapped) is a permanent Notion API error.
func PageIDFromContext ¶ added in v0.4.0
PageIDFromContext extracts the page ID from context, returns empty string if not set.
func ParsePageIDOrURL ¶
ParsePageIDOrURL extracts a Notion page ID from a URL or returns the ID if already bare. Handles various formats: - https://www.notion.so/Page-Title-abc123def456 - https://notion.so/workspace/Page-abc123def456 - abc123def456 (raw ID without dashes) - abc123-def4-5678-90ab-cdef12345678 (raw ID with dashes).
func ParseRichText ¶
ParseRichText converts rich text array to plain string.
func ParseRichTextToMarkdown ¶
ParseRichTextToMarkdown converts rich text array to markdown string.
Types ¶
type APIError ¶
type APIError struct {
Object string `json:"object"`
Status int `json:"status"`
Code string `json:"code"`
Message string `json:"message"`
}
APIError represents a Notion API error.
func (*APIError) IsPermanent ¶ added in v0.6.2
IsPermanent returns true if this error will never resolve by retrying. These are errors where the resource doesn't exist, isn't shared with the integration, or is the wrong type.
type Annotations ¶
type Annotations struct {
Bold bool `json:"bold"`
Italic bool `json:"italic"`
Strikethrough bool `json:"strikethrough"`
Underline bool `json:"underline"`
Code bool `json:"code"`
Color string `json:"color"`
}
Annotations contains text formatting.
type Block ¶
type Block struct {
Object string `json:"object"`
ID string `json:"id"`
Parent Parent `json:"parent"`
Type string `json:"type"`
CreatedTime time.Time `json:"created_time"`
LastEditedTime time.Time `json:"last_edited_time"`
CreatedBy User `json:"created_by"`
LastEditedBy User `json:"last_edited_by"`
HasChildren bool `json:"has_children"`
Archived bool `json:"archived"`
InTrash bool `json:"in_trash"`
// Block type specific content
Paragraph *ParagraphBlock `json:"paragraph,omitempty"`
Heading1 *HeadingBlock `json:"heading_1,omitempty"`
Heading2 *HeadingBlock `json:"heading_2,omitempty"`
Heading3 *HeadingBlock `json:"heading_3,omitempty"`
BulletedListItem *ListItemBlock `json:"bulleted_list_item,omitempty"`
NumberedListItem *ListItemBlock `json:"numbered_list_item,omitempty"`
ToDo *ToDoBlock `json:"to_do,omitempty"`
Toggle *ToggleBlock `json:"toggle,omitempty"`
Code *CodeBlock `json:"code,omitempty"`
Quote *QuoteBlock `json:"quote,omitempty"`
Callout *CalloutBlock `json:"callout,omitempty"`
Divider *DividerBlock `json:"divider,omitempty"`
Image *FileBlock `json:"image,omitempty"`
Video *FileBlock `json:"video,omitempty"`
File *FileBlock `json:"file,omitempty"`
PDF *FileBlock `json:"pdf,omitempty"`
Bookmark *BookmarkBlock `json:"bookmark,omitempty"`
Equation *EquationBlock `json:"equation,omitempty"`
TableOfContents *TableOfContentsBlock `json:"table_of_contents,omitempty"`
ChildPage *ChildPageBlock `json:"child_page,omitempty"`
ChildDatabase *ChildDatabaseBlock `json:"child_database,omitempty"`
SyncedBlock *SyncedBlockBlock `json:"synced_block,omitempty"`
Table *TableBlock `json:"table,omitempty"`
TableRow *TableRowBlock `json:"table_row,omitempty"`
ColumnList *ColumnListBlock `json:"column_list,omitempty"`
Column *ColumnBlock `json:"column,omitempty"`
LinkToPage *LinkToPageBlock `json:"link_to_page,omitempty"`
Embed *EmbedBlock `json:"embed,omitempty"`
// Children holds nested blocks (populated by recursive fetch)
Children []Block `json:"-"`
}
Block represents a Notion block.
type BlockChildrenResponse ¶
type BlockChildrenResponse struct {
Object string `json:"object"`
Results []Block `json:"results"`
NextCursor *string `json:"next_cursor"`
HasMore bool `json:"has_more"`
Type string `json:"type"`
}
BlockChildrenResponse represents the response from block children endpoint.
type BlockFetchResult ¶ added in v0.5.0
type BlockFetchResult struct {
Blocks []Block
WasLimited bool // True if any children were skipped due to depth limit
MaxDepth int // The limit that was applied (0 if unlimited)
}
BlockFetchResult holds the result of fetching blocks with depth limiting.
type BookmarkBlock ¶
BookmarkBlock contains bookmark content.
type Bot ¶
type Bot struct {
Object string `json:"object"`
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Bot struct {
Owner struct {
Type string `json:"type"`
Workspace bool `json:"workspace"`
} `json:"owner"`
WorkspaceName string `json:"workspace_name"`
} `json:"bot"`
}
Bot represents the response from /users/me for a bot.
type BotInfo ¶ added in v0.6.0
type BotInfo struct {
Owner *BotOwner `json:"owner,omitempty"`
WorkspaceOwner string `json:"workspace_owner,omitempty"`
}
BotInfo contains bot-specific user data within a User struct.
type CalloutBlock ¶
type CalloutBlock struct {
RichText []RichText `json:"rich_text"`
Icon *Icon `json:"icon"`
Color string `json:"color"`
}
CalloutBlock contains callout content.
type ChildDatabaseBlock ¶
type ChildDatabaseBlock struct {
Title string `json:"title"`
}
ChildDatabaseBlock references a child database.
type ChildPageBlock ¶
type ChildPageBlock struct {
Title string `json:"title"`
}
ChildPageBlock references a child page.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Notion API client with rate limiting.
func NewClient ¶
func NewClient(token string, opts ...ClientOption) *Client
NewClient creates a new Notion API client.
func (*Client) GetAllBlockChildren ¶
GetAllBlockChildren retrieves all children of a block recursively. The depth parameter is kept for backward compatibility but is no longer used.
func (*Client) GetAllBlockChildrenWithLimit ¶ added in v0.5.0
func (c *Client) GetAllBlockChildrenWithLimit( ctx context.Context, blockID string, maxDepth int, ) (BlockFetchResult, error)
GetAllBlockChildrenWithLimit retrieves all children of a block recursively with an optional depth limit. If maxDepth > 0, recursion stops at that depth level.
func (*Client) GetBlockChildren ¶
func (c *Client) GetBlockChildren(ctx context.Context, blockID string, cursor string) (*BlockChildrenResponse, error)
GetBlockChildren retrieves children of a block with pagination.
func (*Client) GetDataSource ¶ added in v0.6.0
GetDataSource retrieves a data source by ID (schema and properties).
func (*Client) GetDatabase ¶
GetDatabase retrieves a database by ID. In API 2025-09-03+, this fetches the container and first data source to build a backwards-compatible Database struct.
func (*Client) GetDatabaseContainer ¶ added in v0.6.0
func (c *Client) GetDatabaseContainer(ctx context.Context, databaseID string) (*DatabaseContainer, error)
GetDatabaseContainer retrieves database container info with data sources list (API 2025-09-03+).
func (*Client) QueryDataSource ¶ added in v0.6.0
QueryDataSource queries a data source and returns all pages (API 2025-09-03+).
func (*Client) QueryDatabase ¶
QueryDatabase queries a database and returns all pages. In API 2025-09-03+, this resolves the database to its first data source and queries that data source.
func (*Client) Search ¶
func (c *Client) Search(ctx context.Context, filter SearchFilter) (*SearchResponse, error)
Search searches for pages and databases.
func (*Client) SearchAllPages ¶
SearchAllPages retrieves all pages accessible to the integration. The Notion Search API does not support timestamp filtering. All pages are fetched and sorted by last_edited_time (descending = newest first). Callers should filter results by timestamp after retrieval.
func (*Client) SearchAllPagesWithStop ¶
func (c *Client) SearchAllPagesWithStop(ctx context.Context, shouldStop func([]Page) bool) ([]Page, error)
SearchAllPagesWithStop retrieves all pages accessible to the integration with optional early stopping. The shouldStop function is called after each page batch. If it returns true, pagination stops. Pages are sorted by last_edited_time (descending = newest first).
func (*Client) SearchWorkspacePages ¶
SearchWorkspacePages retrieves all pages at workspace level (root pages). These are pages whose parent is a workspace or teamspace, not another page. It searches incrementally and logs progress.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption configures the client.
func WithBaseURL ¶
func WithBaseURL(url string) ClientOption
WithBaseURL sets a custom base URL (useful for testing).
func WithHTTPClient ¶
func WithHTTPClient(c *http.Client) ClientOption
WithHTTPClient sets a custom HTTP client.
type CodeBlock ¶
type CodeBlock struct {
RichText []RichText `json:"rich_text"`
Caption []RichText `json:"caption"`
Language string `json:"language"`
}
CodeBlock contains code content.
type DataSource ¶ added in v0.6.0
type DataSource struct {
Object string `json:"object"` // "data_source"
ID string `json:"id"`
Name string `json:"name"`
CreatedTime time.Time `json:"created_time"`
LastEditedTime time.Time `json:"last_edited_time"`
CreatedBy User `json:"created_by"`
LastEditedBy User `json:"last_edited_by"`
Title []RichText `json:"title"`
Description []RichText `json:"description"`
Properties map[string]any `json:"properties"`
Parent Parent `json:"parent"`
URL string `json:"url"`
Archived bool `json:"archived"`
InTrash bool `json:"in_trash"`
}
DataSource represents a full data source with schema (API 2025-09-03+).
type DataSourceInfo ¶ added in v0.6.0
DataSourceInfo represents basic info about a data source in a database container.
type Database ¶
type Database struct {
Object string `json:"object"`
ID string `json:"id"`
CreatedTime time.Time `json:"created_time"`
LastEditedTime time.Time `json:"last_edited_time"`
CreatedBy User `json:"created_by"`
LastEditedBy User `json:"last_edited_by"`
Title []RichText `json:"title"`
Description []RichText `json:"description"`
Icon *Icon `json:"icon"`
Cover *FileBlock `json:"cover"`
Properties map[string]any `json:"properties"`
Parent Parent `json:"parent"`
URL string `json:"url"`
PublicURL *string `json:"public_url"`
Archived bool `json:"archived"`
InTrash bool `json:"in_trash"`
IsInline bool `json:"is_inline"`
// DataSourceID is the ID of the primary data source (API 2025-09-03+).
DataSourceID string `json:"data_source_id,omitempty"`
// DataSources contains all data sources in this database (API 2025-09-03+).
DataSources []DataSourceInfo `json:"data_sources,omitempty"`
}
Database represents a Notion database. In API version 2025-09-03, this is populated from both the database container and the first data source.
type DatabaseContainer ¶ added in v0.6.0
type DatabaseContainer struct {
Object string `json:"object"` // "database"
ID string `json:"id"`
CreatedTime time.Time `json:"created_time"`
LastEditedTime time.Time `json:"last_edited_time"`
CreatedBy User `json:"created_by"`
LastEditedBy User `json:"last_edited_by"`
DataSources []DataSourceInfo `json:"data_sources"`
Title []RichText `json:"title"`
Description []RichText `json:"description"`
Icon *Icon `json:"icon"`
Cover *FileBlock `json:"cover"`
Parent Parent `json:"parent"`
URL string `json:"url"`
PublicURL *string `json:"public_url"`
IsInline bool `json:"is_inline"`
Archived bool `json:"archived"`
InTrash bool `json:"in_trash"`
}
DatabaseContainer represents the database container response (API 2025-09-03+). GET /databases/{id} now returns this instead of the schema.
type DatabasePage ¶
type DatabasePage struct {
Object string `json:"object"`
ID string `json:"id"`
CreatedTime time.Time `json:"created_time"`
LastEditedTime time.Time `json:"last_edited_time"`
CreatedBy User `json:"created_by"`
LastEditedBy User `json:"last_edited_by"`
Parent Parent `json:"parent"`
Archived bool `json:"archived"`
InTrash bool `json:"in_trash"`
Icon *Icon `json:"icon"`
Cover *FileBlock `json:"cover"`
Properties map[string]json.RawMessage `json:"properties"`
URL string `json:"url"`
PublicURL *string `json:"public_url"`
}
DatabasePage represents a page returned from a database query. It has a simpler structure than Page to handle the complex property types.
func (*DatabasePage) Title ¶
func (p *DatabasePage) Title() string
Title extracts the title from database page properties.
func (*DatabasePage) ToPage ¶
func (p *DatabasePage) ToPage() *Page
ToPage converts a DatabasePage to a regular Page.
type DateProperty ¶
type DateProperty struct {
Start string `json:"start"`
End *string `json:"end,omitempty"`
TimeZone *string `json:"time_zone,omitempty"`
}
DateProperty represents a date property value.
type Equation ¶
type Equation struct {
Expression string `json:"expression"`
}
Equation represents an inline equation.
type EquationBlock ¶
type EquationBlock struct {
Expression string `json:"expression"`
}
EquationBlock contains equation content.
type ExternalFile ¶
type ExternalFile struct {
URL string `json:"url"`
}
ExternalFile represents an external file URL.
type FileBlock ¶
type FileBlock struct {
Type string `json:"type"`
Caption []RichText `json:"caption"`
External *ExternalFile `json:"external,omitempty"`
File *File `json:"file,omitempty"`
Name string `json:"name,omitempty"`
}
FileBlock contains file/image/video content.
type FileObject ¶
type FileObject struct {
Name string `json:"name"`
Type string `json:"type"`
File *File `json:"file,omitempty"`
External *ExternalFile `json:"external,omitempty"`
}
FileObject represents a file in a files property.
type FormulaValue ¶
type FormulaValue struct {
Type string `json:"type"`
String *string `json:"string,omitempty"`
Number *float64 `json:"number,omitempty"`
Boolean *bool `json:"boolean,omitempty"`
Date *DateProperty `json:"date,omitempty"`
}
FormulaValue represents a formula property value.
type HeadingBlock ¶
type HeadingBlock struct {
RichText []RichText `json:"rich_text"`
Color string `json:"color"`
IsToggleable bool `json:"is_toggleable"`
}
HeadingBlock contains heading content.
type Icon ¶
type Icon struct {
Type string `json:"type"`
Emoji string `json:"emoji,omitempty"`
External *ExternalFile `json:"external,omitempty"`
File *File `json:"file,omitempty"`
}
Icon represents an emoji or external icon.
type LinkToPageBlock ¶
type LinkToPageBlock struct {
Type string `json:"type"`
PageID string `json:"page_id,omitempty"`
DatabaseID string `json:"database_id,omitempty"`
}
LinkToPageBlock references another page.
type ListItemBlock ¶
ListItemBlock contains list item content.
type Mention ¶
type Mention struct {
Type string `json:"type"`
User *User `json:"user,omitempty"`
Page *struct {
ID string `json:"id"`
} `json:"page,omitempty"`
Database *struct {
ID string `json:"id"`
} `json:"database,omitempty"`
Date *struct {
Start string `json:"start"`
End *string `json:"end"`
} `json:"date,omitempty"`
LinkPreview *struct {
URL string `json:"url"`
} `json:"link_preview,omitempty"`
}
Mention represents a mention in rich text.
type Page ¶
type Page struct {
Object string `json:"object"`
ID string `json:"id"`
CreatedTime time.Time `json:"created_time"`
LastEditedTime time.Time `json:"last_edited_time"`
CreatedBy User `json:"created_by"`
LastEditedBy User `json:"last_edited_by"`
Parent Parent `json:"parent"`
Archived bool `json:"archived"`
InTrash bool `json:"in_trash"`
Icon *Icon `json:"icon"`
Cover *FileBlock `json:"cover"`
Properties Properties `json:"properties"`
URL string `json:"url"`
PublicURL *string `json:"public_url"`
}
Page represents a Notion page.
type ParagraphBlock ¶
ParagraphBlock contains paragraph content.
type Parent ¶
type Parent struct {
Type string `json:"type"`
PageID string `json:"page_id,omitempty"`
DatabaseID string `json:"database_id,omitempty"`
DataSourceID string `json:"data_source_id,omitempty"` // API 2025-09-03+
BlockID string `json:"block_id,omitempty"`
Workspace bool `json:"workspace,omitempty"`
SpaceID string `json:"space_id,omitempty"` // For teamspaces
}
Parent represents the parent of a page or block.
func (*Parent) IsWorkspaceLevel ¶
IsWorkspaceLevel returns true if the parent is at workspace level (private or teamspace).
type Person ¶ added in v0.6.0
type Person struct {
Email string `json:"email"`
}
Person contains person-specific user data.
type Properties ¶
Properties is a map of property name to property value.
type Property ¶
type Property struct {
ID string `json:"id"`
Type string `json:"type"`
// Title property (for title type)
Title []RichText `json:"title,omitempty"`
// Rich text property
RichText []RichText `json:"rich_text,omitempty"`
// Number property
Number *float64 `json:"number,omitempty"`
// Select property
Select *SelectOption `json:"select,omitempty"`
// Multi-select property
MultiSelect []SelectOption `json:"multi_select,omitempty"`
// Status property
Status *SelectOption `json:"status,omitempty"`
// Date property
Date *DateProperty `json:"date,omitempty"`
// Checkbox property
Checkbox bool `json:"checkbox,omitempty"`
// URL property
URL *string `json:"url,omitempty"`
// Email property
Email *string `json:"email,omitempty"`
// Phone number property
PhoneNumber *string `json:"phone_number,omitempty"`
// Files property
Files []FileObject `json:"files,omitempty"`
// People property
People []User `json:"people,omitempty"`
// Relation property
Relation []RelationItem `json:"relation,omitempty"`
// Rollup property
Rollup *RollupValue `json:"rollup,omitempty"`
// Formula property
Formula *FormulaValue `json:"formula,omitempty"`
// Created by property
CreatedBy *User `json:"created_by,omitempty"`
// Last edited by property
LastEditedBy *User `json:"last_edited_by,omitempty"`
// Created time property
CreatedTime *string `json:"created_time,omitempty"`
// Last edited time property
LastEditedTime *string `json:"last_edited_time,omitempty"`
// Unique ID property
UniqueID *UniqueIDValue `json:"unique_id,omitempty"`
// Verification property
Verification *VerificationValue `json:"verification,omitempty"`
}
Property represents a page property. This handles various property types from both regular pages and database pages.
type QueryDatabaseResponse ¶
type QueryDatabaseResponse struct {
Object string `json:"object"`
Results []DatabasePage `json:"results"`
NextCursor *string `json:"next_cursor"`
HasMore bool `json:"has_more"`
Type string `json:"type"`
}
QueryDatabaseResponse represents the response from querying a database.
type QuoteBlock ¶
QuoteBlock contains quote content.
type RelationItem ¶
type RelationItem struct {
ID string `json:"id"`
}
RelationItem represents an item in a relation property.
type RichText ¶
type RichText struct {
Type string `json:"type"`
PlainText string `json:"plain_text"`
Href *string `json:"href"`
Annotations *Annotations `json:"annotations"`
Text *TextContent `json:"text,omitempty"`
Mention *Mention `json:"mention,omitempty"`
Equation *Equation `json:"equation,omitempty"`
}
RichText represents formatted text.
type RollupValue ¶
type RollupValue struct {
Type string `json:"type"`
Number *float64 `json:"number,omitempty"`
Date *DateProperty `json:"date,omitempty"`
Array []any `json:"array,omitempty"`
}
RollupValue represents a rollup property value.
type SearchFilter ¶
type SearchFilter struct {
Query string
FilterType string // "page" or "data_source" (use "database" for backwards compat, mapped to "data_source")
StartCursor string
PageSize int
// Sort by last_edited_time (only "ascending" or "descending" for timestamp sorting)
SortDirection string // "ascending" or "descending"
}
SearchFilter configures the search query.
type SearchResponse ¶
type SearchResponse struct {
Object string `json:"object"`
Results []Page `json:"results"`
NextCursor *string `json:"next_cursor"`
HasMore bool `json:"has_more"`
Type string `json:"type"`
}
SearchResponse represents the response from the search endpoint.
type SelectOption ¶
type SelectOption struct {
ID string `json:"id,omitempty"`
Name string `json:"name"`
Color string `json:"color,omitempty"`
}
SelectOption represents a select/multi-select/status option.
type SyncedBlockBlock ¶
type SyncedBlockBlock struct {
SyncedFrom *SyncedFrom `json:"synced_from"`
}
SyncedBlockBlock contains synced block reference.
type SyncedFrom ¶
SyncedFrom references the original synced block.
type TableBlock ¶
type TableBlock struct {
TableWidth int `json:"table_width"`
HasColumnHeader bool `json:"has_column_header"`
HasRowHeader bool `json:"has_row_header"`
}
TableBlock contains table settings.
type TableOfContentsBlock ¶
type TableOfContentsBlock struct {
Color string `json:"color"`
}
TableOfContentsBlock contains table of contents settings.
type TableRowBlock ¶
type TableRowBlock struct {
Cells [][]RichText `json:"cells"`
}
TableRowBlock contains table row cells.
type TextContent ¶
TextContent contains text content.
type ToDoBlock ¶
type ToDoBlock struct {
RichText []RichText `json:"rich_text"`
Checked bool `json:"checked"`
Color string `json:"color"`
}
ToDoBlock contains to-do content.
type ToggleBlock ¶
ToggleBlock contains toggle content.
type UniqueIDValue ¶
UniqueIDValue represents a unique ID property value.
type User ¶
type User struct {
Object string `json:"object"`
ID string `json:"id"`
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"`
AvatarURL *string `json:"avatar_url,omitempty"`
Person *Person `json:"person,omitempty"`
Bot *BotInfo `json:"bot,omitempty"`
}
User represents a Notion user reference.
type VerificationValue ¶
type VerificationValue struct {
State string `json:"state"`
VerifiedBy *User `json:"verified_by,omitempty"`
Date *DateProperty `json:"date,omitempty"`
}
VerificationValue represents a verification property value.