Documentation
¶
Overview ¶
Package notion provides a simple and feature-rich Go client for the Notion API.
Index ¶
- Constants
- type APIError
- type AndCompoundFilter
- type Annotations
- type Appearance
- type AppendBlockChildrenRequest
- type AppendBlockChildrenResponse
- type AtomAppearance
- type AtomArchived
- type AtomChildren
- type AtomCreated
- type AtomID
- type AtomLastEdited
- type AtomNoChildren
- type AtomObject
- type AtomPaginatedResponse
- type AtomParent
- type AtomProperties
- type AtomURLs
- type AudioBlock
- type AuthenticationService
- type BasicBlock
- type BasicBlockHolder
- type Block
- type BlockID
- type BlockType
- type BlockUpdateRequest
- type Blocks
- type BlocksService
- func (s *BlocksService) AppendChildren(ctx context.Context, id BlockID, requestBody *AppendBlockChildrenRequest) (*AppendBlockChildrenResponse, error)
- func (s *BlocksService) Delete(ctx context.Context, id BlockID) (Block, error)
- func (s *BlocksService) Get(ctx context.Context, id BlockID) (Block, error)
- func (s *BlocksService) GetChildren(ctx context.Context, id BlockID, pagination *Pagination) (*GetChildrenResponse, error)
- func (s *BlocksService) Update(ctx context.Context, id BlockID, requestBody *BlockUpdateRequest) (Block, error)
- type Bookmark
- type BookmarkBlock
- type Bot
- type Breadcrumb
- type BreadcrumbBlock
- type BulletedListItemBlock
- type Button
- type ButtonProperty
- type ButtonPropertyConfig
- type Callout
- type CalloutBlock
- type CheckboxFilterCondition
- type CheckboxProperty
- type CheckboxPropertyConfig
- type ChildDataBasicBlock
- type ChildDatabase
- type ChildPage
- type ChildPageBlock
- type Client
- type ClientOpt
- type Code
- type CodeBlock
- type Color
- type Column
- type ColumnBlock
- type ColumnList
- type ColumnListBlock
- type Comment
- type CommentCreateRequest
- type CommentID
- type CommentQueryResponse
- type Comments
- type CommentsService
- type CompoundFilter
- type Condition
- type CreatedByProperty
- type CreatedByPropertyConfig
- type CreatedTimeProperty
- type CreatedTimePropertyConfig
- type Cursor
- type Database
- type DatabaseCreateRequest
- type DatabaseID
- type DatabaseMention
- type DatabaseQueryRequest
- type DatabaseQueryResponse
- type DatabaseUpdateRequest
- type DatabasesService
- func (s *DatabasesService) Create(ctx context.Context, requestBody *DatabaseCreateRequest) (*Database, error)
- func (s *DatabasesService) Get(ctx context.Context, id DatabaseID) (*Database, error)
- func (s *DatabasesService) Query(ctx context.Context, id DatabaseID, requestBody *DatabaseQueryRequest) (*DatabaseQueryResponse, error)
- func (s *DatabasesService) Update(ctx context.Context, id DatabaseID, requestBody *DatabaseUpdateRequest) (*Database, error)
- type Date
- type DateFilterCondition
- type DateObject
- type DateProperty
- type DatePropertyConfig
- type DiscussionID
- type Divider
- type DividerBlock
- type DualProperty
- type EmailProperty
- type EmailPropertyConfig
- type Embed
- type EmbedBlock
- type Emoji
- type Equation
- type EquationBlock
- type ErrorCode
- type ExternalAccount
- type File
- type FileBlock
- type FileData
- type FileType
- type Files
- type FilesFilterCondition
- type FilesProperty
- type FilesPropertyConfig
- type Filter
- type FilterOperator
- type FormatType
- type Formula
- type FormulaConfig
- type FormulaFilterCondition
- type FormulaProperty
- type FormulaPropertyConfig
- type FormulaType
- type FunctionType
- type GetChildrenResponse
- type GroupConfig
- type Heading
- type Heading1Block
- type Heading2Block
- type Heading3Block
- type HierarchicalBlock
- type Icon
- type ImageBlock
- type LastEditedByProperty
- type LastEditedByPropertyConfig
- type LastEditedTimeProperty
- type LastEditedTimePropertyConfig
- type Link
- type LinkPreview
- type LinkPreviewBlock
- type LinkToPage
- type LinkToPageBlock
- type LinkToPageType
- type ListItem
- type Media
- type Mention
- type MentionType
- type MultiSelectFilterCondition
- type MultiSelectProperty
- type MultiSelectPropertyConfig
- type NumberFilterCondition
- type NumberFormat
- type NumberProperty
- type NumberPropertyConfig
- type NumberedListItemBlock
- type Object
- type ObjectID
- type ObjectType
- type Objects
- type Option
- type Options
- type OrCompoundFilter
- type Owner
- type Page
- type PageCreateRequest
- type PageID
- type PageMention
- type PageUpdateRequest
- type Pages
- type PagesService
- type Pagination
- type Paragraph
- type ParagraphBlock
- type Parent
- type ParentType
- type PdfBlock
- type PeopleFilterCondition
- type PeopleProperty
- type PeoplePropertyConfig
- type Person
- type PhoneNumberProperty
- type PhoneNumberPropertyConfig
- type Properties
- type Property
- type PropertyArray
- type PropertyConfig
- type PropertyConfigType
- type PropertyConfigs
- type PropertyFilter
- type PropertyID
- type PropertyType
- type Quote
- type QuoteBlock
- type RateLimitedError
- type Relation
- type RelationConfig
- type RelationConfigType
- type RelationFilterCondition
- type RelationObject
- type RelationProperty
- type RelationPropertyConfig
- type RichText
- func NewDatabaseMentionRichText(databaseID ObjectID) *RichText
- func NewEquationBlock(expression string) *RichText
- func NewEquationRichText(expression string) *RichText
- func NewLinkRichText(content, link string) RichText
- func NewPageMentionRichText(pageID ObjectID) *RichText
- func NewTextRichText(text string) RichText
- func NewUserMentionRichText(userID ObjectID) *RichText
- func (rt RichText) WithBold() RichText
- func (rt RichText) WithCode() RichText
- func (rt RichText) WithColor(color Color) RichText
- func (rt RichText) WithItalic() RichText
- func (rt RichText) WithLink(destination string) RichText
- func (rt RichText) WithStrikethrough() RichText
- func (rt RichText) WithUnderline() RichText
- type RichTextProperty
- type RichTextPropertyConfig
- type RichTextType
- type RichTexts
- type Rollup
- type RollupConfig
- type RollupFilterCondition
- type RollupProperty
- type RollupPropertyConfig
- type RollupSubfilterCondition
- type RollupType
- type SearchFilter
- type SearchRequest
- type SearchResponse
- type SearchService
- type Select
- type SelectFilterCondition
- type SelectProperty
- type SelectPropertyConfig
- type SingleProperty
- type SortObject
- type SortOrder
- type Status
- type StatusConfig
- type StatusFilterCondition
- type StatusProperty
- type StatusPropertyConfig
- type Synced
- type SyncedBlock
- type SyncedFrom
- type Table
- type TableBlock
- type TableOfContents
- type TableOfContentsBlock
- type TableRow
- type TableRowBlock
- type Template
- type TemplateBlock
- type TemplateMention
- type TemplateMentionType
- type Text
- type TextFilterCondition
- type TextProperty
- type TimestampFilter
- type TimestampType
- type TitleProperty
- type TitlePropertyConfig
- type ToDo
- type ToDoBlock
- type Toggle
- type ToggleBlock
- type Token
- type TokenCreateError
- type TokenCreateRequest
- type TokenCreateResponse
- type URLProperty
- type URLPropertyConfig
- type UniqueID
- type UniqueIDConfig
- type UniqueIDFilterCondition
- type UniqueIDProperty
- type UniqueIDPropertyConfig
- type UnsupportedBlock
- type User
- type UserID
- type UserMention
- type UserType
- type Users
- type UsersListResponse
- type UsersService
- type Verification
- type VerificationProperty
- type VerificationPropertyConfig
- type VerificationState
- type VideoBlock
Constants ¶
const EmojiTypeEmoji = "emoji"
EmojiTypeEmoji is hardcoded const type for any Emoji
const EmptyCursor = ""
EmptyCursor is a constant for empty cursor.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶ added in v0.0.3
type APIError struct { Object ObjectType `json:"object"` Status int `json:"status"` Code ErrorCode `json:"code"` Message string `json:"message"` }
APIError is a type for Notion API errors.
type AndCompoundFilter ¶
type AndCompoundFilter []Filter
AndCompoundFilter is a type for `and` compound filters.
func (AndCompoundFilter) MarshalJSON ¶
func (f AndCompoundFilter) MarshalJSON() ([]byte, error)
MarshalJSON implements custom marshalling for AndCompoundFilter and OrCompoundFilter
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 Color `json:"color"` }
Annotations is a set of annotations for RichText
type Appearance ¶ added in v0.0.3
type Appearance interface { // GetIcon returns the Icon of the Appearance. GetIcon() *Icon // GetCover returns the Cover of the Appearance. GetCover() *File }
Appearance is an interface for Blocks that can have an icon and/or a cover.
type AppendBlockChildrenRequest ¶
type AppendBlockChildrenRequest struct { // Append new children after a specific block. If empty, new children with be appended to the bottom of the parent block. After BlockID `json:"after,omitempty"` // Child content to append to a container block as an array of block objects. Children Blocks `json:"children"` }
AppendBlockChildrenRequest is a type for append block children request.
type AppendBlockChildrenResponse ¶
type AppendBlockChildrenResponse struct { Object ObjectType `json:"object"` Results []Block `json:"results"` }
AppendBlockChildrenResponse is a type for append block children response.
func (*AppendBlockChildrenResponse) UnmarshalJSON ¶
func (r *AppendBlockChildrenResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON does custom unmarshalling for AppendBlockChildrenResponse
type AtomAppearance ¶ added in v0.0.3
type AtomAppearance struct { Icon *Icon `json:"icon,omitempty"` Cover *File `json:"cover,omitempty"` }
AtomAppearance is a container for the shared fields of the base Notion objects.
func (AtomAppearance) GetCover ¶ added in v0.0.3
func (a AtomAppearance) GetCover() *File
GetCover returns the Cover of the AtomAppearance.
func (AtomAppearance) GetIcon ¶ added in v0.0.3
func (a AtomAppearance) GetIcon() *Icon
GetIcon returns the Icon of the AtomAppearance.
type AtomArchived ¶ added in v0.0.3
AtomArchived stands for Archived + InTrash
func (AtomArchived) GetArchived ¶ added in v0.0.3
func (a AtomArchived) GetArchived() bool
GetArchived returns the Archived bool of the AtomArchived.
func (AtomArchived) GetInTrash ¶ added in v0.0.3
func (a AtomArchived) GetInTrash() bool
GetInTrash returns the InTrash bool of the AtomArchived.
type AtomChildren ¶ added in v0.0.3
type AtomChildren struct {
Children Blocks `json:"children"`
}
AtomChildren stands for atom that holds children.
func (*AtomChildren) AppendChildren ¶ added in v0.0.3
func (a *AtomChildren) AppendChildren(c ...Block)
AppendChildren appends the children of the AtomChildren.
func (AtomChildren) ChildCount ¶ added in v0.0.3
func (a AtomChildren) ChildCount() int
ChildCount returns the number
func (AtomChildren) GetChildren ¶ added in v0.0.3
func (a AtomChildren) GetChildren() Blocks
GetChildren returns the children of the AtomChildren.
func (*AtomChildren) SetChildren ¶ added in v0.0.3
func (a *AtomChildren) SetChildren(c Blocks)
SetChildren sets the children of the AtomChildren.
type AtomCreated ¶ added in v0.0.3
type AtomCreated struct { CreatedTime *time.Time `json:"created_time,omitempty"` CreatedBy *User `json:"created_by,omitempty"` }
AtomCreated stands for CreatedTime + CreatedBy fields
func (AtomCreated) GetCreatedBy ¶ added in v0.0.3
func (a AtomCreated) GetCreatedBy() *User
GetCreatedBy returns the CreatedBy of the AtomCreated.
func (AtomCreated) GetCreatedTime ¶ added in v0.0.3
func (a AtomCreated) GetCreatedTime() *time.Time
GetCreatedTime returns the CreatedTime of the AtomCreated.
type AtomID ¶ added in v0.0.3
type AtomID struct {
ID ObjectID `json:"id,omitempty"`
}
AtomID stands for ID + Parent reference
type AtomLastEdited ¶ added in v0.0.3
type AtomLastEdited struct { LastEditedTime *time.Time `json:"last_edited_time"` LastEditedBy *User `json:"last_edited_by"` }
AtomLastEdited stands for atom that holds Notion's last edited time and by.
func (AtomLastEdited) GetLastEditedBy ¶ added in v0.0.3
func (a AtomLastEdited) GetLastEditedBy() *User
GetLastEditedBy returns the LastEditedBy of the AtomLastEdited.
func (AtomLastEdited) GetLastEditedTime ¶ added in v0.0.3
func (a AtomLastEdited) GetLastEditedTime() *time.Time
GetLastEditedTime returns the LastEditedTime of the AtomLastEdited.
type AtomNoChildren ¶ added in v0.0.3
type AtomNoChildren struct{}
AtomNoChildren should be embedded in all blocks that do not have children.
func (AtomNoChildren) AppendChildren ¶ added in v0.0.3
func (AtomNoChildren) AppendChildren(...Block)
AppendChildren panics for the AtomNoChildren.
func (AtomNoChildren) ChildCount ¶ added in v0.0.3
func (AtomNoChildren) ChildCount() int
ChildCount returns 0 for the AtomNoChildren.
func (AtomNoChildren) GetChildren ¶ added in v0.0.3
func (AtomNoChildren) GetChildren() Blocks
GetChildren returns nil for the AtomNoChildren.
func (AtomNoChildren) SetChildren ¶ added in v0.0.3
func (AtomNoChildren) SetChildren(Blocks)
SetChildren panics for the AtomNoChildren.
type AtomObject ¶ added in v0.0.3
type AtomObject struct {
Object ObjectType `json:"object"`
}
AtomObject stands for atom that holds object (ObjctType).
func (AtomObject) GetObject ¶ added in v0.0.3
func (b AtomObject) GetObject() ObjectType
GetObject returns the object (ObjectType) of the AtomObject.
type AtomPaginatedResponse ¶ added in v0.0.3
type AtomPaginatedResponse struct { Object ObjectType `json:"object"` NextCursor Cursor `json:"next_cursor"` HasMore bool `json:"has_more"` }
AtomPaginatedResponse is embedded in all paginated responses.
type AtomParent ¶ added in v0.0.3
type AtomParent struct {
Parent Parent `json:"parent"`
}
AtomParent stands for atom that holds Notion's parent object.
func (AtomParent) GetParent ¶ added in v0.0.3
func (a AtomParent) GetParent() Parent
GetParent returns the parent of the AtomParent.
type AtomProperties ¶ added in v0.0.3
type AtomProperties struct {
Properties Properties `json:"properties"`
}
AtomProperties stands for atom that holds Notion's properties.
func (AtomProperties) GetProperties ¶ added in v0.0.3
func (a AtomProperties) GetProperties() Properties
GetProperties returns the properties of the AtomProperties.
type AtomURLs ¶ added in v0.0.3
AtomURLs stands for atom that holds Notion's URLs.
func (AtomURLs) GetPublicURL ¶ added in v0.0.3
GetPublicURL returns the PublicURL of the AtomURLs.
type AudioBlock ¶
type AudioBlock struct { BasicBlock Audio File `json:"audio"` }
AudioBlock is a Notion block for audio files
func NewAudioBlock ¶
func NewAudioBlock(audio File) *AudioBlock
NewAudioBlock creates a new AudioBlock
func (*AudioBlock) GetExpiryTime ¶ added in v0.0.3
func (b *AudioBlock) GetExpiryTime() *time.Time
GetExpiryTime implements Media interface for AudioBlock
func (*AudioBlock) GetURL ¶ added in v0.0.3
func (b *AudioBlock) GetURL() string
GetURL implements Media interface for AudioBlock
func (*AudioBlock) SetBasicBlock ¶ added in v0.0.3
func (b *AudioBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type AuthenticationService ¶
type AuthenticationService struct {
// contains filtered or unexported fields
}
AuthenticationService is a service for Notion Authentication API.
func (*AuthenticationService) CreateToken ¶
func (s *AuthenticationService) CreateToken(ctx context.Context, request *TokenCreateRequest) (*TokenCreateResponse, error)
CreateToken creates an access token that a third-party service can use to authenticate with Notion.
type BasicBlock ¶
type BasicBlock struct { AtomID AtomParent AtomObject AtomCreated AtomLastEdited AtomArchived AtomAppearance // blocks by default have NO children unless it's specified on the custom block implementation AtomNoChildren Type BlockType `json:"type"` HasChildren bool `json:"has_children,omitempty"` }
BasicBlock defines the common fields of all Notion block types. See https://developers.notion.com/reference/block for the list. BasicBlock implements the Block interface.
func NewBasicBlock ¶
func NewBasicBlock(blockType BlockType, hasChildrenArg ...bool) BasicBlock
NewBasicBlock returns a new BasicBlock with the ObjectTypeBlock and given block type. It's used as a basic block for all other blocks.
func (BasicBlock) GetBasicBlock ¶ added in v0.0.3
func (b BasicBlock) GetBasicBlock() BasicBlock
GetBasicBlock returns the BasicBlock (itself).
func (BasicBlock) GetHasChildren ¶
func (b BasicBlock) GetHasChildren() bool
GetHasChildren returns the HasChildren of the BasicBlock.
func (BasicBlock) GetObject ¶
func (b BasicBlock) GetObject() ObjectType
GetObject returns the ObjectType of the BasicBlock. Always returns ObjectTypeBlock.
func (BasicBlock) GetType ¶
func (b BasicBlock) GetType() BlockType
GetType returns the Type of the BasicBlock.
type BasicBlockHolder ¶ added in v0.0.3
type BasicBlockHolder interface { GetBasicBlock() BasicBlock SetBasicBlock(BasicBlock) Block }
BasicBlockHolder is a block that can handle its GetBasicBlock It's not supposed to be widely used, but it's useful for testing, and other tasks where you need reflect-type Block access
type Block ¶
type Block interface { Object // Every block is an Object by default GetID() BlockID GetParent() Parent GetType() BlockType GetCreatedTime() *time.Time GetCreatedBy() *User GetLastEditedTime() *time.Time GetLastEditedBy() *User GetArchived() bool GetInTrash() bool GetHasChildren() bool }
Block is a general interface for ALL types of notion Blocks.
func NewHeadingBlock ¶
NewHeadingBlock returns a new Heading[1-3]Block (hidden below Block interface) corresponding to the given heading level. It defaults to Heading 3 if the given level is not supported.
type BlockID ¶
type BlockID = ObjectID
BlockID stands for ID of Block object. As Block is an Object, then BlockID is just an alias for Object
type BlockType ¶
type BlockType string
BlockType is a type of a Notion block.
const ( BlockTypeParagraph BlockType = "paragraph" BlockTypeHeading1 BlockType = "heading_1" BlockTypeHeading2 BlockType = "heading_2" BlockTypeHeading3 BlockType = "heading_3" BlockTypeBulletedListItem BlockType = "bulleted_list_item" BlockTypeNumberedListItem BlockType = "numbered_list_item" BlockTypeToDo BlockType = "to_do" BlockTypeToggle BlockType = "toggle" BlockTypeChildPage BlockType = "child_page" BlockTypeChildDatabase BlockType = "child_database" BlockTypeEmbed BlockType = "embed" BlockTypeImage BlockType = "image" BlockTypeAudio BlockType = "audio" BlockTypeVideo BlockType = "video" BlockTypeFile BlockType = "file" BlockTypePdf BlockType = "pdf" BlockTypeBookmark BlockType = "bookmark" BlockTypeCode BlockType = "code" BlockTypeDivider BlockType = "divider" BlockTypeCallout BlockType = "callout" BlockTypeQuote BlockType = "quote" BlockTypeTableOfContents BlockType = "table_of_contents" BlockTypeEquation BlockType = "equation" BlockTypeBreadcrumb BlockType = "breadcrumb" BlockTypeColumn BlockType = "column" BlockTypeColumnList BlockType = "column_list" BlockTypeLinkPreview BlockType = "link_preview" BlockTypeLinkToPage BlockType = "link_to_page" BlockTypeSyncedBlock BlockType = "synced_block" BlockTypeTable BlockType = "table" BlockTypeTableRow BlockType = "table_row" BlockTypeUnsupported BlockType = "unsupported" )
See https://developers.notion.com/reference/block nolint:revive
const ( // BlockTypeTemplate is a block type for template blocks. // Deprecated // See https://developers.notion.com/reference/block#template BlockTypeTemplate BlockType = "template" )
type BlockUpdateRequest ¶
type BlockUpdateRequest struct { Paragraph *Paragraph `json:"paragraph,omitempty"` Heading1 *Heading `json:"heading_1,omitempty"` Heading2 *Heading `json:"heading_2,omitempty"` Heading3 *Heading `json:"heading_3,omitempty"` BulletedListItem *ListItem `json:"bulleted_list_item,omitempty"` NumberedListItem *ListItem `json:"numbered_list_item,omitempty"` Code *Code `json:"code,omitempty"` ToDo *ToDo `json:"to_do,omitempty"` Toggle *Toggle `json:"toggle,omitempty"` Embed *Embed `json:"embed,omitempty"` Image *File `json:"image,omitempty"` Video *File `json:"video,omitempty"` File *File `json:"file,omitempty"` Pdf *File `json:"pdf,omitempty"` Bookmark *Bookmark `json:"bookmark,omitempty"` Template *Template `json:"template,omitempty"` Callout *Callout `json:"callout,omitempty"` Equation *Equation `json:"equation,omitempty"` Quote *Quote `json:"quote,omitempty"` TableRow *TableRow `json:"table_row,omitempty"` }
BlockUpdateRequest is a type for block update request.
type Blocks ¶
type Blocks []Block
Blocks is a slice of (generic) Block objects.
func (*Blocks) UnmarshalJSON ¶
UnmarshalJSON implements custom unmarshalling for Blocks It's required because each type of Block will have its own type-based field. see decodeBlock() for more details
type BlocksService ¶ added in v0.0.3
type BlocksService struct {
// contains filtered or unexported fields
}
BlocksService is a service for the Blocks Notion API.
func (*BlocksService) AppendChildren ¶ added in v0.0.3
func (s *BlocksService) AppendChildren(ctx context.Context, id BlockID, requestBody *AppendBlockChildrenRequest) (*AppendBlockChildrenResponse, error)
AppendChildren creates and appends new children blocks to the parent block_id specified. Blocks can be parented by other blocks, pages, or databases.
Returns a paginated list of newly created first level children block objects.
Existing blocks cannot be moved using this endpoint. Blocks are appended to the bottom of the parent block. Once a block is appended as a child, it can't be moved elsewhere via the API.
For blocks that allow children, we allow up to two levels of nesting in a single request.
See https://developers.notion.com/reference/patch-block-children
func (*BlocksService) Delete ¶ added in v0.0.3
Delete sets a Block object, including page blocks, to archived: true using the ID specified. Note: in the Notion UI application, this moves the block to the "Trash" where it can still be accessed and restored.
To restore the block with the API, use the Update a block or Update page respectively.
func (*BlocksService) Get ¶ added in v0.0.3
Get retrieves a Block object using the ID specified.
Get https://developers.notion.com/reference/retrieve-a-block
func (*BlocksService) GetChildren ¶ added in v0.0.3
func (s *BlocksService) GetChildren(ctx context.Context, id BlockID, pagination *Pagination) (*GetChildrenResponse, error)
GetChildren returns a paginated array of child block objects contained in the block using the ID specified. In order to receive a complete representation of a block, you may need to recursively retrieve the block children of child blocks.
See https://developers.notion.com/reference/get-block-children
func (*BlocksService) Update ¶ added in v0.0.3
func (s *BlocksService) Update(ctx context.Context, id BlockID, requestBody *BlockUpdateRequest) (Block, error)
Update updates the content for the specified block_id based on the block type. Supported fields based on the block object type (see Block object for available fields and the expected input for each field).
Note: The update replaces the entire value for a given field. If a field is omitted (ex: omitting checked when updating a to_do block), the value will not be changed.
type BookmarkBlock ¶
type BookmarkBlock struct { BasicBlock Bookmark Bookmark `json:"bookmark"` }
BookmarkBlock is a Notion block for a bookmark.
func NewBookmarkBlock ¶
func NewBookmarkBlock(b Bookmark) *BookmarkBlock
NewBookmarkBlock creates a new BookmarkBlock.
func (*BookmarkBlock) SetBasicBlock ¶ added in v0.0.3
func (b *BookmarkBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type Breadcrumb ¶
type Breadcrumb struct{}
Breadcrumb is a block that represents a breadcrumb. Contains nothing.
type BreadcrumbBlock ¶
type BreadcrumbBlock struct { BasicBlock Breadcrumb Breadcrumb `json:"breadcrumb"` }
BreadcrumbBlock is a Notion block for a breadcrumb.
func NewBreadcrumbBlock ¶
func NewBreadcrumbBlock() *BreadcrumbBlock
NewBreadcrumbBlock creates a new BreadcrumbBlock.
func (*BreadcrumbBlock) SetBasicBlock ¶ added in v0.0.3
func (b *BreadcrumbBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type BulletedListItemBlock ¶
type BulletedListItemBlock struct { BasicBlock BulletedListItem ListItem `json:"bulleted_list_item"` }
BulletedListItemBlock is a Notion block for bulleted list items
func NewBulletedListItemBlock ¶
func NewBulletedListItemBlock(li ListItem) *BulletedListItemBlock
NewBulletedListItemBlock creates a new BulletedListItemBlock
func (*BulletedListItemBlock) AppendChildren ¶ added in v0.0.3
func (b *BulletedListItemBlock) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*BulletedListItemBlock) SetBasicBlock ¶ added in v0.0.3
func (b *BulletedListItemBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*BulletedListItemBlock) SetChildren ¶
func (b *BulletedListItemBlock) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type ButtonProperty ¶
type ButtonProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Button Button `json:"button"` }
ButtonProperty is a type for button property.
func (ButtonProperty) GetID ¶
func (p ButtonProperty) GetID() string
GetID returns the ID of the ButtonProperty.
func (ButtonProperty) GetType ¶
func (p ButtonProperty) GetType() PropertyType
GetType returns the Type of the ButtonProperty.
type ButtonPropertyConfig ¶
type ButtonPropertyConfig struct { ID PropertyID `json:"id"` Type PropertyConfigType `json:"type"` Button any `json:"button"` }
ButtonPropertyConfig is a type for button property configs.
func (ButtonPropertyConfig) GetID ¶
func (p ButtonPropertyConfig) GetID() PropertyID
GetID returns the ID of the ButtonPropertyConfig.
func (ButtonPropertyConfig) GetType ¶
func (p ButtonPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the ButtonPropertyConfig.
type Callout ¶
type Callout struct { AtomChildren RichText RichTexts `json:"rich_text"` Icon *Icon `json:"icon,omitempty"` Color Color `json:"color,omitempty"` }
Callout is a block that represents a callout (icon + color + rich text).
type CalloutBlock ¶
type CalloutBlock struct { BasicBlock Callout Callout `json:"callout"` }
CalloutBlock is a Notion block for a callout.
func NewCalloutBlock ¶
func NewCalloutBlock(c Callout) *CalloutBlock
NewCalloutBlock creates a new CalloutBlock.
func (*CalloutBlock) AppendChildren ¶ added in v0.0.3
func (b *CalloutBlock) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*CalloutBlock) SetBasicBlock ¶ added in v0.0.3
func (b *CalloutBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*CalloutBlock) SetChildren ¶
func (b *CalloutBlock) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type CheckboxFilterCondition ¶
type CheckboxFilterCondition struct { Equals bool `json:"equals,omitempty"` DoesNotEqual bool `json:"does_not_equal,omitempty"` }
CheckboxFilterCondition is a type for checkbox filter conditions.
type CheckboxProperty ¶
type CheckboxProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Checkbox bool `json:"checkbox"` }
CheckboxProperty is a type for checkbox property.
func (CheckboxProperty) GetID ¶
func (p CheckboxProperty) GetID() string
GetID returns the ID of the CheckboxProperty.
func (CheckboxProperty) GetType ¶
func (p CheckboxProperty) GetType() PropertyType
GetType returns the Type of the CheckboxProperty.
type CheckboxPropertyConfig ¶
type CheckboxPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Checkbox any `json:"checkbox"` }
CheckboxPropertyConfig is a type for checkbox property configs.
func (CheckboxPropertyConfig) GetID ¶
func (p CheckboxPropertyConfig) GetID() PropertyID
GetID returns the ID of the CheckboxPropertyConfig.
func (CheckboxPropertyConfig) GetType ¶
func (p CheckboxPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the CheckboxPropertyConfig.
type ChildDataBasicBlock ¶ added in v0.0.3
type ChildDataBasicBlock struct { BasicBlock ChildDatabase ChildDatabase `json:"child_database"` }
ChildDataBasicBlock is a Notion block for ChildDatabase
func NewChildDataBasicBlock ¶ added in v0.0.3
func NewChildDataBasicBlock(title string) *ChildDataBasicBlock
NewChildDataBasicBlock returns a new ChildDataBasicBlock with the given title
func (*ChildDataBasicBlock) SetBasicBlock ¶ added in v0.0.3
func (b *ChildDataBasicBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type ChildDatabase ¶ added in v0.0.3
type ChildDatabase struct {
Title string `json:"title"`
}
ChildDatabase stores the title of the child database
type ChildPage ¶ added in v0.0.3
type ChildPage struct {
Title string `json:"title"`
}
ChildPage stores the title of the child page
type ChildPageBlock ¶
type ChildPageBlock struct { BasicBlock ChildPage ChildPage `json:"child_database"` }
ChildPageBlock is a Notion block for ChildPage
func NewChildPageBlock ¶
func NewChildPageBlock(title string) *ChildPageBlock
NewChildPageBlock returns a new ChildPageBlock with the given title
func (*ChildPageBlock) SetBasicBlock ¶ added in v0.0.3
func (b *ChildPageBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type Client ¶
type Client struct { Auth *AuthenticationService Blocks *BlocksService Pages *PagesService Databases *DatabasesService Users *UsersService Comments *CommentsService Search *SearchService // contains filtered or unexported fields }
Client is a Notion SDK client.
type ClientOpt ¶ added in v0.0.3
type ClientOpt func(*Client)
ClientOpt to configure API client
func WithOAuthAppCredentials ¶
WithOAuthAppCredentials sets the OAuth app ID and secret to use when fetching a token from Notion.
func WithTransport ¶ added in v0.0.3
func WithTransport(transport http.RoundTripper) ClientOpt
WithTransport overrides the default http.Client
func WithVersion ¶
WithVersion overrides the Notion API version
type Code ¶
type Code struct { RichText RichTexts `json:"rich_text"` Caption RichTexts `json:"caption,omitempty"` Language string `json:"language"` }
Code stores the code, caption, and language of the code block
type CodeBlock ¶
type CodeBlock struct { BasicBlock Code Code `json:"code"` }
CodeBlock is a Notion block for Code
func NewCodeBlock ¶
NewCodeBlock returns a new CodeBlock with the given code
func (*CodeBlock) SetBasicBlock ¶ added in v0.0.3
func (b *CodeBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type Color ¶
type Color string
Color is a type for Notion colors.
const ( ColorDefault Color = "default" ColorGray Color = "gray" ColorBrown Color = "brown" ColorOrange Color = "orange" ColorYellow Color = "yellow" ColorGreen Color = "green" ColorBlue Color = "blue" ColorPurple Color = "purple" ColorPink Color = "pink" ColorRed Color = "red" ColorDefaultBackground Color = "default_background" ColorGrayBackground Color = "gray_background" ColorBrownBackground Color = "brown_background" ColorOrangeBackground Color = "orange_background" ColorYellowBackground Color = "yellow_background" ColorGreenBackground Color = "green_background" ColorBlueBackground Color = "blue_background" ColorPurpleBackground Color = "purple_background" ColorPinkBackground Color = "pink_background" ColorRedBackground Color = "red_background" )
nolint:revive
func (Color) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
type ColumnBlock ¶
type ColumnBlock struct { BasicBlock Column Column `json:"column"` }
ColumnBlock is a Notion block for Column
func NewColumnBlock ¶
func NewColumnBlock(col Column) *ColumnBlock
NewColumnBlock returns a new ColumnBlock with the given column
func (*ColumnBlock) AppendChildren ¶ added in v0.0.3
func (b *ColumnBlock) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*ColumnBlock) SetBasicBlock ¶ added in v0.0.3
func (b *ColumnBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*ColumnBlock) SetChildren ¶
func (b *ColumnBlock) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type ColumnList ¶
type ColumnList struct { // Children can only contain column blocks // Children should have at least 2 blocks when appending. // TODO^ validate this AtomChildren }
ColumnList stores the children of the column list block
type ColumnListBlock ¶
type ColumnListBlock struct { BasicBlock ColumnList ColumnList `json:"column_list"` }
ColumnListBlock is a Notion block for ColumnList
func NewColumnListBlock ¶
func NewColumnListBlock(col ColumnList) *ColumnListBlock
NewColumnListBlock returns a new ColumnListBlock with the given column list
func (*ColumnListBlock) AppendChildren ¶ added in v0.0.3
func (b *ColumnListBlock) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*ColumnListBlock) SetBasicBlock ¶ added in v0.0.3
func (b *ColumnListBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*ColumnListBlock) SetChildren ¶
func (b *ColumnListBlock) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type Comment ¶
type Comment struct { AtomObject AtomID AtomParent AtomCreated // LastEditedTime is declared manually, outside of AtomLastEdited, // because we do not have LastEditedBy field here. LastEditedTime *time.Time `json:"last_edited_time,omitempty"` DiscussionID DiscussionID `json:"discussion_id"` RichText RichTexts `json:"rich_text"` }
Comment is a Notion object that represents a comment.
type CommentCreateRequest ¶
type CommentCreateRequest struct { Parent Parent `json:"parent,omitempty"` DiscussionID DiscussionID `json:"discussion_id,omitempty"` RichText RichTexts `json:"rich_text"` }
CommentCreateRequest represents the request body for CommentClient.Create.
type CommentID ¶
type CommentID = ObjectID
CommentID stands for ID of Comment object. As Comment is an Object, then CommentID is just an alias for Object
type CommentQueryResponse ¶
type CommentQueryResponse struct { AtomPaginatedResponse Results Comments `json:"results"` }
CommentQueryResponse is a type for comment query response.
type CommentsService ¶ added in v0.0.3
type CommentsService struct {
// contains filtered or unexported fields
}
CommentsService is a service for the Comments Notion API.
func (*CommentsService) Create ¶ added in v0.0.3
func (s *CommentsService) Create(ctx context.Context, requestBody *CommentCreateRequest) (*Comment, error)
Create creates a comment in a page or existing discussion thread.
There are two locations you can add a new comment to: 1. A page 2. An existing discussion thread
If the intention is to add a new comment to a page, a parent object must be provided in the body params. Alternatively, if a new comment is being added to an existing discussion thread, the discussion_id string must be provided in the body params. Exactly one of these parameters must be provided.
See https://developers.notion.com/reference/create-a-comment
func (*CommentsService) Get ¶ added in v0.0.3
func (s *CommentsService) Get(ctx context.Context, id ObjectID, pagination *Pagination) (*CommentQueryResponse, error)
Get retrieves a list of un-resolved Comment objects from a page or block.
See https://developers.notion.com/reference/retrieve-a-comment
type CompoundFilter ¶
type CompoundFilter map[FilterOperator][]PropertyFilter
CompoundFilter is a type for compound filters.
type Condition ¶
type Condition string
Condition is a type for filter conditions.
const ( ConditionEquals Condition = "equals" ConditionDoesNotEqual Condition = "does_not_equal" ConditionContains Condition = "contains" ConditionDoesNotContain Condition = "does_not_contain" ConditionDoesStartsWith Condition = "starts_with" ConditionDoesEndsWith Condition = "ends_with" ConditionDoesIsEmpty Condition = "is_empty" ConditionGreaterThan Condition = "greater_than" ConditionLessThan Condition = "less_than" ConditionGreaterThanOrEqualTo Condition = "greater_than_or_equal_to" ConditionLessThanOrEqualTo Condition = "greater_than_or_equal_to" ConditionBefore Condition = "before" ConditionAfter Condition = "after" ConditionOnOrBefore Condition = "on_or_before" ConditionOnOrAfter Condition = "on_or_after" ConditionPastWeek Condition = "past_week" ConditionPastMonth Condition = "past_month" ConditionPastYear Condition = "past_year" ConditionNextWeek Condition = "next_week" ConditionNextMonth Condition = "next_month" ConditionNextYear Condition = "next_year" ConditionText Condition = "text" ConditionCheckbox Condition = "checkbox" ConditionNumber Condition = "number" ConditionDate Condition = "date" )
nolint:revive
type CreatedByProperty ¶
type CreatedByProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` CreatedBy User `json:"created_by"` }
CreatedByProperty is a type for created by property.
func (CreatedByProperty) GetID ¶
func (p CreatedByProperty) GetID() string
GetID returns the ID of the CreatedByProperty.
func (CreatedByProperty) GetType ¶
func (p CreatedByProperty) GetType() PropertyType
GetType returns the Type of the CreatedByProperty.
type CreatedByPropertyConfig ¶
type CreatedByPropertyConfig struct { ID PropertyID `json:"id"` Type PropertyConfigType `json:"type"` CreatedBy any `json:"created_by"` }
CreatedByPropertyConfig is a type for created by property configs.
func (CreatedByPropertyConfig) GetID ¶
func (p CreatedByPropertyConfig) GetID() PropertyID
GetID returns the ID of the CreatedByPropertyConfig.
func (CreatedByPropertyConfig) GetType ¶
func (p CreatedByPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the CreatedByPropertyConfig.
type CreatedTimeProperty ¶
type CreatedTimeProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` CreatedTime time.Time `json:"created_time"` }
CreatedTimeProperty is a type for created time property.
func (CreatedTimeProperty) GetID ¶
func (p CreatedTimeProperty) GetID() string
GetID returns the ID of the CreatedTimeProperty.
func (CreatedTimeProperty) GetType ¶
func (p CreatedTimeProperty) GetType() PropertyType
GetType returns the Type of the CreatedTimeProperty.
type CreatedTimePropertyConfig ¶
type CreatedTimePropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` CreatedTime any `json:"created_time"` }
CreatedTimePropertyConfig is a type for created time property configs.
func (CreatedTimePropertyConfig) GetID ¶
func (p CreatedTimePropertyConfig) GetID() PropertyID
GetID returns the ID of the CreatedTimePropertyConfig.
func (CreatedTimePropertyConfig) GetType ¶
func (p CreatedTimePropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the CreatedTimePropertyConfig.
type Database ¶
type Database struct { AtomObject AtomID AtomParent AtomCreated AtomLastEdited AtomArchived AtomAppearance AtomURLs // Title of the page is represented via RichTexts(type==text) Title RichTexts `json:"title"` // Description of the page is represented via RichTexts(type==text) Description RichTexts `json:"description"` IsInline bool `json:"is_inline"` // Properties is a map of property configurations that defines what Page.Properties each page of the database can use Properties PropertyConfigs `json:"properties"` }
Database is a Notion object that represents a database.
func (*Database) GetObject ¶
func (db *Database) GetObject() ObjectType
GetObject always returns ObjectTypeDatabase
type DatabaseCreateRequest ¶
type DatabaseCreateRequest struct { // A page parent. Parent Parent `json:"parent"` // Title of database as it appears in Notion. An array of rich text objects. Title RichTexts `json:"title"` // Property schema of database. The keys are the names of properties as they // appear in Notion and the values are property schema objects. Properties PropertyConfigs `json:"properties"` IsInline bool `json:"is_inline"` }
DatabaseCreateRequest represents the request body for DatabaseClient.Create.
type DatabaseID ¶
type DatabaseID = ObjectID
DatabaseID stands for ID of Database object. As Database is an Object, then DatabaseID is just an alias for Object
type DatabaseMention ¶
type DatabaseMention struct {
ID ObjectID `json:"id"`
}
DatabaseMention is a database mention object
type DatabaseQueryRequest ¶
type DatabaseQueryRequest struct { // When supplied, limits which pages are returned based on the filter // conditions. Filter Filter // When supplied, orders the results based on the provided sort criteria. Sorts []SortObject `json:"sorts,omitempty"` // When supplied, returns a page of results starting after the cursor provided. // If not supplied, this endpoint will return the first page of results. StartCursor Cursor `json:"start_cursor,omitempty"` // The number of items from the full list desired in the response. Maximum: 100 PageSize int `json:"page_size,omitempty"` }
DatabaseQueryRequest represents the request body for DatabaseClient.Query.
func (*DatabaseQueryRequest) MarshalJSON ¶
func (qr *DatabaseQueryRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements custom Query marshalling
type DatabaseQueryResponse ¶
type DatabaseQueryResponse struct { AtomPaginatedResponse Results Pages `json:"results"` }
DatabaseQueryResponse is a response for DatabaseQueryRequest.
type DatabaseUpdateRequest ¶
type DatabaseUpdateRequest struct { // An array of rich text objects that represents the title of the database // that is displayed in the Notion UI. If omitted, then the database title // remains unchanged. Title RichTexts `json:"title,omitempty"` // The properties of a database to be changed in the request, in the form of // a JSON object. If updating an existing property, then the keys are the // names or IDs of the properties as they appear in Notion, and the values are // property schema objects. If adding a new property, then the key is the name // of the new database property and the value is a property schema object. Properties PropertyConfigs `json:"properties,omitempty"` }
DatabaseUpdateRequest represents the request body for DatabaseClient.Update.
type DatabasesService ¶ added in v0.0.3
type DatabasesService struct {
// contains filtered or unexported fields
}
DatabasesService is a service for Notion Databases API.
func (*DatabasesService) Create ¶ added in v0.0.3
func (s *DatabasesService) Create(ctx context.Context, requestBody *DatabaseCreateRequest) (*Database, error)
Create creates a database as a subpage in the specified parent page, with the specified properties schema. Currently, the parent of a new database must be a Notion page.
See https://developers.notion.com/reference/create-a-database
func (*DatabasesService) Get ¶ added in v0.0.3
func (s *DatabasesService) Get(ctx context.Context, id DatabaseID) (*Database, error)
Get gets a database by ID.
func (*DatabasesService) Query ¶ added in v0.0.3
func (s *DatabasesService) Query(ctx context.Context, id DatabaseID, requestBody *DatabaseQueryRequest) (*DatabaseQueryResponse, error)
Query gets a list of Pages contained in the database, filtered and ordered according to the filter conditions and sort criteria provided in the request. The response may contain fewer than page_size of results. If the response includes a next_cursor value, refer to the pagination reference for details about how to use a cursor to iterate through the list.
Filters are similar to the filters provided in the Notion UI where the set of filters and filter groups chained by "And" in the UI is equivalent to having each filter in the array of the compound "and" filter. Similar a set of filters chained by "Or" in the UI would be represented as filters in the array of the "or" compound filter.
Filters operate on database properties and can be combined. If no filter is provided, all the pages in the database will be returned with pagination.
See https://developers.notion.com/reference/post-database-query
func (*DatabasesService) Update ¶ added in v0.0.3
func (s *DatabasesService) Update(ctx context.Context, id DatabaseID, requestBody *DatabaseUpdateRequest) (*Database, error)
Update updates a Database by id
type Date ¶
Date is a type for Notion dates.
func (Date) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Date) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type DateFilterCondition ¶
type DateFilterCondition struct { Equals *Date `json:"equals,omitempty"` Before *Date `json:"before,omitempty"` After *Date `json:"after,omitempty"` OnOrBefore *Date `json:"on_or_before,omitempty"` OnOrAfter *Date `json:"on_or_after,omitempty"` PastWeek *struct{} `json:"past_week,omitempty"` PastMonth *struct{} `json:"past_month,omitempty"` PastYear *struct{} `json:"past_year,omitempty"` NextWeek *struct{} `json:"next_week,omitempty"` NextMonth *struct{} `json:"next_month,omitempty"` NextYear *struct{} `json:"next_year,omitempty"` IsEmpty bool `json:"is_empty,omitempty"` IsNotEmpty bool `json:"is_not_empty,omitempty"` }
DateFilterCondition is a type for date
type DateObject ¶
DateObject is a type for date object.
type DateProperty ¶
type DateProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Date *DateObject `json:"date"` }
DateProperty is a type for date property.
func (DateProperty) GetID ¶
func (p DateProperty) GetID() string
GetID returns the ID of the DateProperty.
func (DateProperty) GetType ¶
func (p DateProperty) GetType() PropertyType
GetType returns the Type of the DateProperty.
type DatePropertyConfig ¶
type DatePropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Date any `json:"date"` }
DatePropertyConfig is a type for date property configs.
func (DatePropertyConfig) GetID ¶
func (p DatePropertyConfig) GetID() PropertyID
GetID returns the ID of the DatePropertyConfig.
func (DatePropertyConfig) GetType ¶
func (p DatePropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the DatePropertyConfig.
type DiscussionID ¶
type DiscussionID string
DiscussionID stands for ID of the Discussion.
func (DiscussionID) String ¶
func (dID DiscussionID) String() string
String returns the string representation of the DiscussionID.
type DividerBlock ¶
type DividerBlock struct { BasicBlock Divider Divider `json:"divider"` }
DividerBlock is a Notion block for Divider
func NewDividerBlock ¶
func NewDividerBlock() *DividerBlock
NewDividerBlock returns a new DividerBlock
func (*DividerBlock) SetBasicBlock ¶ added in v0.0.3
func (b *DividerBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type EmailProperty ¶
type EmailProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Email string `json:"email"` }
EmailProperty is a type for email property.
func (EmailProperty) GetID ¶
func (p EmailProperty) GetID() string
GetID returns the ID of the EmailProperty.
func (EmailProperty) GetType ¶
func (p EmailProperty) GetType() PropertyType
GetType returns the Type of the EmailProperty.
type EmailPropertyConfig ¶
type EmailPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Email any `json:"email"` }
EmailPropertyConfig is a type for email property configs.
func (EmailPropertyConfig) GetID ¶
func (p EmailPropertyConfig) GetID() PropertyID
GetID returns the ID of the EmailPropertyConfig.
func (EmailPropertyConfig) GetType ¶
func (p EmailPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the EmailPropertyConfig.
type EmbedBlock ¶
type EmbedBlock struct { BasicBlock Embed Embed `json:"embed"` }
EmbedBlock is a Notion block for Embed
func NewEmbedBlock ¶
func NewEmbedBlock(embed Embed) *EmbedBlock
NewEmbedBlock returns a new EmbedBlock with the given embed
func (*EmbedBlock) SetBasicBlock ¶ added in v0.0.3
func (b *EmbedBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type Equation ¶
type Equation struct {
Expression string `json:"expression"`
}
Equation holds the equation expression It's used both for inline equations and standalone equations.
type EquationBlock ¶
type EquationBlock struct { BasicBlock Equation Equation `json:"equation"` }
EquationBlock is a Notion block for Standalone equation blocks It differs from inline Equation: Inline equations are always part of paragraph (or other parent block) Standalone equations are always standalone blocks
func (*EquationBlock) SetBasicBlock ¶ added in v0.0.3
func (b *EquationBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type ExternalAccount ¶
ExternalAccount is a type for external account.
type File ¶
type File struct { Caption RichTexts `json:"caption,omitempty"` Type FileType `json:"type"` File *FileData `json:"file,omitempty"` External *FileData `json:"external,omitempty"` }
File is a file object.
func (File) GetExpiryTime ¶ added in v0.0.3
GetExpiryTime returns the ExpiryTime of the File.
type FileBlock ¶
type FileBlock struct { BasicBlock File File `json:"file"` }
FileBlock is a Notion block for files
func (*FileBlock) GetExpiryTime ¶
GetExpiryTime implements Media interface for FileBlock
func (*FileBlock) SetBasicBlock ¶ added in v0.0.3
func (b *FileBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type FileData ¶ added in v0.0.3
type FileData struct { URL string `json:"url,omitempty"` ExpiryTime *time.Time `json:"expiry_time,omitempty"` }
FileData is a file Data object
type FileType ¶
type FileType string
FileType is a type of a Notion file. See https://developers.notion.com/reference/file-object
type FilesFilterCondition ¶
type FilesFilterCondition struct { IsEmpty bool `json:"is_empty,omitempty"` IsNotEmpty bool `json:"is_not_empty,omitempty"` }
FilesFilterCondition is a type for files filter conditions.
type FilesProperty ¶
type FilesProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Files Files `json:"files"` }
FilesProperty is a type for files property.
func (FilesProperty) GetID ¶
func (p FilesProperty) GetID() string
GetID returns the ID of the FilesProperty.
func (FilesProperty) GetType ¶
func (p FilesProperty) GetType() PropertyType
GetType returns the Type of the FilesProperty.
type FilesPropertyConfig ¶
type FilesPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Files any `json:"files"` }
FilesPropertyConfig is a type for files property configs.
func (FilesPropertyConfig) GetID ¶
func (p FilesPropertyConfig) GetID() PropertyID
GetID returns the ID of the FilesPropertyConfig.
func (FilesPropertyConfig) GetType ¶
func (p FilesPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the FilesPropertyConfig.
type Filter ¶
type Filter interface {
// contains filtered or unexported methods
}
Filter is an interface for filter types. TODO: refactor probably
type FilterOperator ¶
type FilterOperator string
FilterOperator is a type for filter operators.
const ( FilterOperatorAND FilterOperator = "and" FilterOperatorOR FilterOperator = "or" )
nolint:revive
type FormatType ¶
type FormatType string
FormatType is a type for format types.
const ( FormatNumber FormatType = "number" FormatNumberWithCommas FormatType = "number_with_commas" FormatPercent FormatType = "percent" FormatDollar FormatType = "dollar" FormatCanadianDollar FormatType = "canadian_dollar" FormatEuro FormatType = "euro" FormatPound FormatType = "pound" FormatYen FormatType = "yen" FormatRuble FormatType = "ruble" FormatRupee FormatType = "rupee" FormatWon FormatType = "won" FormatYuan FormatType = "yuan" FormatReal FormatType = "real" FormatLira FormatType = "lira" FormatRupiah FormatType = "rupiah" FormatFranc FormatType = "franc" FormatHongKongDollar FormatType = "hong_kong_dollar" FormatNewZealandDollar FormatType = "hong_kong_dollar" FormatKrona FormatType = "krona" FormatNorwegianKrone FormatType = "norwegian_krone" FormatMexicanPeso FormatType = "mexican_peso" FormatRand FormatType = "rand" FormatNewTaiwanDollar FormatType = "new_taiwan_dollar" FormatDanishKrone FormatType = "danish_krone" FormatZloty FormatType = "zloty" FormatBath FormatType = "baht" FormatForint FormatType = "forint" FormatKoruna FormatType = "koruna" FormatShekel FormatType = "shekel" FormatChileanPeso FormatType = "chilean_peso" FormatPhilippinePeso FormatType = "philippine_peso" FormatDirham FormatType = "dirham" FormatColombianPeso FormatType = "colombian_peso" FormatRiyal FormatType = "riyal" FormatRinggit FormatType = "ringgit" FormatLeu FormatType = "leu" FormatArgentinePeso FormatType = "argentine_peso" FormatUruguayanPeso FormatType = "uruguayan_peso" FormatSingaporeDollar FormatType = "singapore_dollar" )
nolint:revive
func (FormatType) String ¶
func (ft FormatType) String() string
String returns the string representation of the FormatType.
type Formula ¶
type Formula struct { Type FormulaType `json:"type,omitempty"` String string `json:"string,omitempty"` Number float64 `json:"number,omitempty"` Boolean bool `json:"boolean,omitempty"` Date *DateObject `json:"date,omitempty"` }
Formula is a type for formula.
type FormulaConfig ¶
type FormulaConfig struct {
Expression string `json:"expression"`
}
FormulaConfig is a type for formula configs.
type FormulaFilterCondition ¶
type FormulaFilterCondition struct { // DEPRECATED use `String` instead Text *TextFilterCondition `json:"text,omitempty"` String *TextFilterCondition `json:"string,omitempty"` Checkbox *CheckboxFilterCondition `json:"checkbox,omitempty"` Number *NumberFilterCondition `json:"number,omitempty"` Date *DateFilterCondition `json:"date,omitempty"` }
FormulaFilterCondition is a type for formula filter conditions.
type FormulaProperty ¶
type FormulaProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Formula Formula `json:"formula"` }
FormulaProperty is a type for formula property.
func (FormulaProperty) GetID ¶
func (p FormulaProperty) GetID() string
GetID returns the ID of the FormulaProperty.
func (FormulaProperty) GetType ¶
func (p FormulaProperty) GetType() PropertyType
GetType returns the Type of the FormulaProperty.
type FormulaPropertyConfig ¶
type FormulaPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Formula FormulaConfig `json:"formula"` }
FormulaPropertyConfig is a type for formula property configs.
func (FormulaPropertyConfig) GetID ¶
func (p FormulaPropertyConfig) GetID() PropertyID
GetID returns the ID of the FormulaPropertyConfig.
func (FormulaPropertyConfig) GetType ¶
func (p FormulaPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the FormulaPropertyConfig.
type FormulaType ¶
type FormulaType string
FormulaType is a type for formula types.
const ( FormulaTypeString FormulaType = "string" FormulaTypeNumber FormulaType = "number" FormulaTypeBoolean FormulaType = "boolean" FormulaTypeDate FormulaType = "date" )
nolint:revive
type FunctionType ¶
type FunctionType string
FunctionType is a type for function types.
const ( FunctionCountAll FunctionType = "count_all" FunctionCountValues FunctionType = "count_values" FunctionCountUniqueValues FunctionType = "count_unique_values" FunctionCountEmpty FunctionType = "count_empty" FunctionCountNotEmpty FunctionType = "count_not_empty" FunctionPercentEmpty FunctionType = "percent_empty" FunctionPercentNotEmpty FunctionType = "percent_not_empty" FunctionSum FunctionType = "sum" FunctionAverage FunctionType = "average" FunctionMedian FunctionType = "median" FunctionMin FunctionType = "min" FunctionMax FunctionType = "max" FunctionRange FunctionType = "range" )
nolint:revive
func (FunctionType) String ¶
func (ft FunctionType) String() string
String returns the string representation of the FunctionType.
type GetChildrenResponse ¶
type GetChildrenResponse struct { AtomPaginatedResponse Results Blocks `json:"results"` }
GetChildrenResponse is a type for get children response.
type GroupConfig ¶
type GroupConfig struct { ID ObjectID `json:"id"` Name string `json:"name"` Color string `json:"color"` OptionIDs []ObjectID `json:"option_ids"` }
GroupConfig is a type for group configs.
type Heading ¶
type Heading struct { AtomChildren RichText RichTexts `json:"rich_text"` Color Color `json:"color,omitempty"` IsToggleable bool `json:"is_toggleable,omitempty"` }
Heading stores the heading data.
type Heading1Block ¶
type Heading1Block struct { BasicBlock Heading1 Heading `json:"heading_1"` }
Heading1Block is a Notion block for Heading1
func NewHeading1Block ¶
func NewHeading1Block(h Heading) *Heading1Block
NewHeading1Block returns a new Heading1Block with the given heading
func (*Heading1Block) AppendChildren ¶ added in v0.0.3
func (b *Heading1Block) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*Heading1Block) SetBasicBlock ¶ added in v0.0.3
func (b *Heading1Block) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*Heading1Block) SetChildren ¶
func (b *Heading1Block) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type Heading2Block ¶
type Heading2Block struct { BasicBlock Heading2 Heading `json:"heading_2"` }
Heading2Block is a Notion block for Heading2
func NewHeading2Block ¶
func NewHeading2Block(h Heading) *Heading2Block
NewHeading2Block returns a new Heading2Block with the given heading
func (*Heading2Block) AppendChildren ¶ added in v0.0.3
func (b *Heading2Block) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*Heading2Block) SetBasicBlock ¶ added in v0.0.3
func (b *Heading2Block) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*Heading2Block) SetChildren ¶
func (b *Heading2Block) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type Heading3Block ¶
type Heading3Block struct { BasicBlock Heading3 Heading `json:"heading_3"` }
Heading3Block is a Notion block for Heading3
func NewHeading3Block ¶
func NewHeading3Block(h Heading) *Heading3Block
NewHeading3Block returns a new Heading3Block with the given heading
func (*Heading3Block) AppendChildren ¶ added in v0.0.3
func (b *Heading3Block) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*Heading3Block) SetBasicBlock ¶ added in v0.0.3
func (b *Heading3Block) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*Heading3Block) SetChildren ¶
func (b *Heading3Block) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type HierarchicalBlock ¶ added in v0.0.3
type HierarchicalBlock interface { GetChildren() Blocks SetChildren(Blocks) AppendChildren(...Block) ChildCount() int }
HierarchicalBlock is a block that can handle its GetChildren Even childfree blocks should implement it (see AtomChildfree)
type Icon ¶
type Icon struct { Type FileType `json:"type"` // external or emoji External *File `json:"external,omitempty"` Emoji Emoji `json:"emoji,omitempty"` }
Icon is an type union of FileObject(type==external) and Emoji Icon must be filled in 2 possible ways: 1. Type==external, External is not nil (Emoji is nil) 2. Type==emoji, Emoji is not nil (External is nil)
func NewEmojiIcon ¶ added in v0.0.3
NewEmojiIcon returns a new Icon with a given Emoji.
func NewExternalIcon ¶ added in v0.0.3
NewExternalIcon returns a new Icon with a given external File URL.
type ImageBlock ¶
type ImageBlock struct { BasicBlock Image File `json:"image"` }
ImageBlock is a Notion block for images
func NewImageBlock ¶
func NewImageBlock(data File) *ImageBlock
NewImageBlock creates a new ImageBlock
func (*ImageBlock) GetExpiryTime ¶
func (b *ImageBlock) GetExpiryTime() *time.Time
GetExpiryTime implements Media interface for ImageBlock
func (*ImageBlock) GetURL ¶
func (b *ImageBlock) GetURL() string
GetURL implements Media interface for ImageBlock
func (*ImageBlock) SetBasicBlock ¶ added in v0.0.3
func (b *ImageBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type LastEditedByProperty ¶
type LastEditedByProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` LastEditedBy User `json:"last_edited_by"` }
LastEditedByProperty is a type for last edited by property.
func (LastEditedByProperty) GetID ¶
func (p LastEditedByProperty) GetID() string
GetID returns the ID of the LastEditedByProperty.
func (LastEditedByProperty) GetType ¶
func (p LastEditedByProperty) GetType() PropertyType
GetType returns the Type of the LastEditedBy
type LastEditedByPropertyConfig ¶
type LastEditedByPropertyConfig struct { ID PropertyID `json:"id"` Type PropertyConfigType `json:"type"` LastEditedBy any `json:"last_edited_by"` }
LastEditedByPropertyConfig is a type for last edited by property configs.
func (LastEditedByPropertyConfig) GetID ¶
func (p LastEditedByPropertyConfig) GetID() PropertyID
GetID returns the ID of the LastEditedByPropertyConfig.
func (LastEditedByPropertyConfig) GetType ¶
func (p LastEditedByPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the LastEditedByPropertyConfig.
type LastEditedTimeProperty ¶
type LastEditedTimeProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` LastEditedTime time.Time `json:"last_edited_time"` }
LastEditedTimeProperty is a type for last edited time property.
func (LastEditedTimeProperty) GetID ¶
func (p LastEditedTimeProperty) GetID() string
GetID returns the ID of the LastEditedTimeProperty.
func (LastEditedTimeProperty) GetType ¶
func (p LastEditedTimeProperty) GetType() PropertyType
GetType returns the Type of the LastEditedTimeProperty.
type LastEditedTimePropertyConfig ¶
type LastEditedTimePropertyConfig struct { ID PropertyID `json:"id"` Type PropertyConfigType `json:"type"` LastEditedTime any `json:"last_edited_time"` }
LastEditedTimePropertyConfig is a type for last edited time property configs.
func (LastEditedTimePropertyConfig) GetID ¶
func (p LastEditedTimePropertyConfig) GetID() PropertyID
GetID returns the ID of the LastEditedTimePropertyConfig.
func (LastEditedTimePropertyConfig) GetType ¶
func (p LastEditedTimePropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the LastEditedTimePropertyConfig.
type Link ¶
type Link struct {
URL string `json:"url,omitempty"`
}
Link is a link object to be used in RichText.Text.Link
type LinkPreview ¶
type LinkPreview struct {
URL string `json:"url"`
}
LinkPreview is a type for link preview.
type LinkPreviewBlock ¶
type LinkPreviewBlock struct { BasicBlock LinkPreview LinkPreview `json:"link_preview"` }
LinkPreviewBlock is a Notion block for link preview blocks NOTE: will only be returned by the API. Cannot be created by the API.
func NewLinkPreviewBlock ¶
func NewLinkPreviewBlock(lp LinkPreview) *LinkPreviewBlock
NewLinkPreviewBlock creates a new LinkPreviewBlock. Deprecated: as now publishing new LinkPreview blocks to Notion is allowed
func (*LinkPreviewBlock) SetBasicBlock ¶ added in v0.0.3
func (b *LinkPreviewBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type LinkToPage ¶
type LinkToPage struct { Type LinkToPageType `json:"type"` PageID PageID `json:"page_id,omitempty"` DatabaseID DatabaseID `json:"database_id,omitempty"` }
LinkToPage holds a link to a page or database
type LinkToPageBlock ¶
type LinkToPageBlock struct { BasicBlock LinkToPage LinkToPage `json:"link_to_page"` }
LinkToPageBlock is a Notion block for LinkToPage
func NewLinkToDatabaseBlock ¶ added in v0.0.3
func NewLinkToDatabaseBlock(dbID DatabaseID) *LinkToPageBlock
NewLinkToDatabaseBlock creates a new LinkToPageBlock (type==database)
func NewLinkToPageBlock ¶
func NewLinkToPageBlock(pageID PageID) *LinkToPageBlock
NewLinkToPageBlock creates a new LinkToPageBlock (type==page)
func (*LinkToPageBlock) SetBasicBlock ¶ added in v0.0.3
func (b *LinkToPageBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type LinkToPageType ¶ added in v0.0.3
type LinkToPageType string
LinkToPageType is a type for LinkToPage.Type
const ( // LinkToPageTypePage is a type for LinkToPage.Type LinkToPageTypePage LinkToPageType = "page" // LinkToPageTypeDatabase is a type for LinkToPage.Type LinkToPageTypeDatabase LinkToPageType = "database" )
type ListItem ¶
type ListItem struct { AtomChildren RichText RichTexts `json:"rich_text"` Color string `json:"color,omitempty"` }
ListItem is a type for bulleted and numbered list items
type Media ¶ added in v0.0.3
Media is an interface for blocks that can be downloaded such as Pdf, FileBlock, and Image
type Mention ¶
type Mention struct { Type MentionType `json:"type,omitempty"` Database *DatabaseMention `json:"database,omitempty"` Page *PageMention `json:"page,omitempty"` User *UserMention `json:"user,omitempty"` Date *DateObject `json:"date,omitempty"` TemplateMention *TemplateMention `json:"template_mention,omitempty"` }
Mention is an Object that holds mention to something (database, page, etc)
type MentionType ¶
type MentionType string
MentionType is a type of a mention
const ( MentionTypeDatabase MentionType = "database" MentionTypePage MentionType = "page" MentionTypeUser MentionType = "user" MentionTypeDate MentionType = "date" MentionTypeLinkPreview MentionType = "link_preview" MentionTypeTemplateMention MentionType = "template_mention" )
nolint:revive
func (MentionType) String ¶
func (v MentionType) String() string
String returns the string representation of the MentionType
type MultiSelectFilterCondition ¶
type MultiSelectFilterCondition struct { Contains string `json:"contains,omitempty"` DoesNotContain string `json:"does_not_contain,omitempty"` IsEmpty bool `json:"is_empty,omitempty"` IsNotEmpty bool `json:"is_not_empty,omitempty"` }
MultiSelectFilterCondition is a type for multi-select filter conditions.
type MultiSelectProperty ¶
type MultiSelectProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` MultiSelect []Option `json:"multi_select"` }
MultiSelectProperty is a type for multi-select property.
func (MultiSelectProperty) GetID ¶
func (p MultiSelectProperty) GetID() string
GetID returns the ID of the MultiSelectProperty.
func (MultiSelectProperty) GetType ¶
func (p MultiSelectProperty) GetType() PropertyType
GetType returns the Type of the MultiSelectProperty.
type MultiSelectPropertyConfig ¶
type MultiSelectPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` MultiSelect Select `json:"multi_select"` }
MultiSelectPropertyConfig is a type for multi-select property configs.
func (MultiSelectPropertyConfig) GetID ¶
func (p MultiSelectPropertyConfig) GetID() PropertyID
GetID returns the ID of the MultiSelectPropertyConfig.
func (MultiSelectPropertyConfig) GetType ¶
func (p MultiSelectPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the MultiSelectPropertyConfig.
type NumberFilterCondition ¶
type NumberFilterCondition struct { Equals *float64 `json:"equals,omitempty"` DoesNotEqual *float64 `json:"does_not_equal,omitempty"` GreaterThan *float64 `json:"greater_than,omitempty"` LessThan *float64 `json:"less_than,omitempty"` GreaterThanOrEqualTo *float64 `json:"greater_than_or_equal_to,omitempty"` LessThanOrEqualTo *float64 `json:"less_than_or_equal_to,omitempty"` IsEmpty bool `json:"is_empty,omitempty"` IsNotEmpty bool `json:"is_not_empty,omitempty"` }
NumberFilterCondition is a type for number filter conditions.
type NumberFormat ¶
type NumberFormat struct {
Format FormatType `json:"format"`
}
NumberFormat is a type for number formats.
type NumberProperty ¶
type NumberProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Number float64 `json:"number"` }
NumberProperty is a type for number property.
func (NumberProperty) GetID ¶
func (p NumberProperty) GetID() string
GetID returns the ID of the NumberProperty.
func (NumberProperty) GetType ¶
func (p NumberProperty) GetType() PropertyType
GetType returns the Type of the NumberProperty.
type NumberPropertyConfig ¶
type NumberPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Number NumberFormat `json:"number"` }
NumberPropertyConfig is a type for number property configs.
func (NumberPropertyConfig) GetID ¶
func (p NumberPropertyConfig) GetID() PropertyID
GetID returns the ID of the NumberPropertyConfig.
func (NumberPropertyConfig) GetType ¶
func (p NumberPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the NumberPropertyConfig.
type NumberedListItemBlock ¶
type NumberedListItemBlock struct { BasicBlock NumberedListItem ListItem `json:"numbered_list_item"` }
NumberedListItemBlock is a Notion block for numbered list items
func NewNumberedListItemBlock ¶
func NewNumberedListItemBlock(li ListItem) *NumberedListItemBlock
NewNumberedListItemBlock creates a new NumberedListItemBlock
func (*NumberedListItemBlock) AppendChildren ¶ added in v0.0.3
func (b *NumberedListItemBlock) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*NumberedListItemBlock) SetBasicBlock ¶ added in v0.0.3
func (b *NumberedListItemBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*NumberedListItemBlock) SetChildren ¶
func (b *NumberedListItemBlock) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type Object ¶
type Object interface {
GetObject() ObjectType
}
Object is an interface for all Notion objects. ObjectType ("object") field is the only shared field between all objects.
type ObjectID ¶
type ObjectID string
ObjectID is a unique identifier for a Notion object. It is set on the Notion side only (immutable and read-only). It will be ignored if you manually set its value for the new objects.
type ObjectType ¶
type ObjectType string
ObjectType is a type of a Notion object.
const ( ObjectTypeDatabase ObjectType = "database" ObjectTypeBlock ObjectType = "block" ObjectTypePage ObjectType = "page" ObjectTypeList ObjectType = "list" ObjectTypeText ObjectType = "text" ObjectTypeUser ObjectType = "user" ObjectTypeError ObjectType = "error" ObjectTypeComment ObjectType = "comment" )
nolint:revive
func (ObjectType) String ¶
func (ot ObjectType) String() string
String returns the string representation of the ObjectType.
type Option ¶
type Option struct { ID PropertyID `json:"id,omitempty"` Name string `json:"name"` Color Color `json:"color,omitempty"` }
Option is a type for option.
type OrCompoundFilter ¶
type OrCompoundFilter []Filter
OrCompoundFilter is a type for `or` compound filters.
func (OrCompoundFilter) MarshalJSON ¶
func (f OrCompoundFilter) MarshalJSON() ([]byte, error)
MarshalJSON implements custom marshalling for OrCompoundFilter
type Page ¶
type Page struct { AtomObject AtomID AtomParent AtomCreated AtomLastEdited AtomArchived AtomAppearance AtomURLs AtomProperties }
The Page object contains the page property values of a single Notion page.
See https://developers.notion.com/reference/page
func (*Page) GetObject ¶
func (p *Page) GetObject() ObjectType
GetObject always returns ObjectTypePage
type PageCreateRequest ¶
type PageCreateRequest struct { // The parent page or database where the new page is inserted, represented as // a JSON object with a page_id or database_id key, and the corresponding ID. // Required field. Parent Parent `json:"parent"` // The values of the page’s properties. If the parent is a database, then the // schema must match the parent database’s properties. If the parent is a page, // then the only valid object key is title. // Required field. Properties Properties `json:"properties"` // The content to be rendered on the new page, represented as an array of // block objects. Children Blocks `json:"children,omitempty"` // The icon of the new page. Either an emoji object or an external file object. Icon *Icon `json:"icon,omitempty"` // The cover image of the new page, represented as a file object. Cover *File `json:"cover,omitempty"` }
PageCreateRequest represents the request body for PagesClient.Create.
type PageID ¶
type PageID = ObjectID
PageID stands for ID of Page object. As Page is an Object, then PageID is just an alias for Object
type PageMention ¶
type PageMention struct {
ID ObjectID `json:"id"`
}
PageMention is a page mention object
type PageUpdateRequest ¶
type PageUpdateRequest struct { // The property values to update for the page. The keys are the names or IDs // of the property and the values are property values. If a page property ID // is not included, then it is not changed. Properties Properties `json:"properties,omitempty"` // Whether the page is archived (deleted). Set to true to archive a page. Set // to false to un-archive (restore) a page. Archived bool `json:"archived"` // A page icon for the page. Supported types are external file object or emoji // object. Icon *Icon `json:"icon,omitempty"` // A cover image for the page. Only external file objects are supported. Cover *File `json:"cover,omitempty"` }
PageUpdateRequest represents the request body for PagesClient.Update.
type PagesService ¶ added in v0.0.3
type PagesService struct {
// contains filtered or unexported fields
}
PagesService is a service for the Pages Notion API.
func (*PagesService) Create ¶ added in v0.0.3
func (s *PagesService) Create(ctx context.Context, requestBody *PageCreateRequest) (*Page, error)
Create creates a new page that is a child of an existing page or database.
If the new page is a child of an existing page,title is the only valid property in the properties body param.
If the new page is a child of an existing database, the keys of the properties object body param must match the parent database's properties.
This endpoint can be used to create a new page with or without content using the children option. To add content to a page after creating it, use the Append block children endpoint.
Returns a new page object.
func (*PagesService) Get ¶ added in v0.0.3
Get retrieves a Page object using the ID specified.
Responses contains page properties, not page content. To fetch page content, use the Retrieve block children endpoint.
Page properties are limited to up to 25 references per page property. To retrieve data related to properties that have more than 25 references, use the Retrieve a page property endpoint.
func (*PagesService) Update ¶ added in v0.0.3
func (s *PagesService) Update(ctx context.Context, id PageID, request *PageUpdateRequest) (*Page, error)
Update updates the properties of a page in a database. The properties body param of this endpoint can only be used to update the properties of a page that is a child of a database. The page’s properties schema must match the parent database’s properties.
This endpoint can be used to update any page icon or cover, and can be used to archive or restore any page.
To add page content instead of page properties, use the append block children endpoint. The page_id can be passed as the block_id when adding block children to the page.
Returns the updated page object.
type Pagination ¶
Pagination is a type for Notion pagination.
func (*Pagination) ToQuery ¶
func (p *Pagination) ToQuery() map[string]string
ToQuery returns a map of query parameters for the pagination.
type Paragraph ¶
type Paragraph struct { AtomChildren RichText RichTexts `json:"rich_text"` Color Color `json:"color,omitempty"` }
Paragraph is a type for paragraph blocks
type ParagraphBlock ¶
type ParagraphBlock struct { BasicBlock Paragraph Paragraph `json:"paragraph"` }
ParagraphBlock is a Notion block for paragraph blocks
func NewParagraphBlock ¶
func NewParagraphBlock(p Paragraph) *ParagraphBlock
NewParagraphBlock creates a new ParagraphBlock
func (*ParagraphBlock) AppendChildren ¶ added in v0.0.3
func (b *ParagraphBlock) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*ParagraphBlock) SetBasicBlock ¶ added in v0.0.3
func (b *ParagraphBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*ParagraphBlock) SetChildren ¶
func (b *ParagraphBlock) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type Parent ¶
type Parent struct { Type ParentType `json:"type,omitempty"` PageID PageID `json:"page_id,omitempty"` DatabaseID DatabaseID `json:"database_id,omitempty"` BlockID BlockID `json:"block_id,omitempty"` Workspace bool `json:"workspace,omitempty"` }
Parent is a type for Notion's Parent object: Pages, databases, and blocks are either located inside other pages, databases, and blocks, or are located at the top level of a workspace. This location is known as the "parent". Parent information is represented by a consistent parent object throughout the API.
func NewBlockParent ¶ added in v0.0.3
NewBlockParent returns a Block parent.
func NewDatabaseParent ¶ added in v0.0.3
func NewDatabaseParent(databaseID DatabaseID) Parent
NewDatabaseParent returns a Database parent.
func NewPageParent ¶ added in v0.0.3
NewPageParent returns a Page Parent.
func NewWorkspaceParent ¶ added in v0.0.3
func NewWorkspaceParent() Parent
NewWorkspaceParent returns a Workspace parent.
type ParentType ¶
type ParentType string
ParentType is a type of a Notion parent. See https://developers.notion.com/reference/parent-object
const ( ParentTypeDatabaseID ParentType = "database_id" ParentTypePageID ParentType = "page_id" ParentTypeBlockID ParentType = "block_id" ParentTypeWorkspace ParentType = "workspace" )
nolint:revive
type PdfBlock ¶
type PdfBlock struct { BasicBlock Pdf File `json:"pdf"` }
PdfBlock is a Notion block for PDF files
func (*PdfBlock) GetExpiryTime ¶
GetExpiryTime implements Media interface for PdfBlock
func (*PdfBlock) SetBasicBlock ¶ added in v0.0.3
func (b *PdfBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type PeopleFilterCondition ¶
type PeopleFilterCondition struct { Contains string `json:"contains,omitempty"` DoesNotContain string `json:"does_not_contain,omitempty"` IsEmpty bool `json:"is_empty,omitempty"` IsNotEmpty bool `json:"is_not_empty,omitempty"` }
PeopleFilterCondition is a type for people filter conditions.
type PeopleProperty ¶
type PeopleProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` People Users `json:"people"` }
PeopleProperty is a type for people property.
func (PeopleProperty) GetID ¶
func (p PeopleProperty) GetID() string
GetID returns the ID of the PeopleProperty.
func (PeopleProperty) GetType ¶
func (p PeopleProperty) GetType() PropertyType
GetType returns the Type of the PeopleProperty.
type PeoplePropertyConfig ¶
type PeoplePropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` People any `json:"people"` }
PeoplePropertyConfig is a type for people property configs.
func (PeoplePropertyConfig) GetID ¶
func (p PeoplePropertyConfig) GetID() PropertyID
GetID returns the ID of the PeoplePropertyConfig.
func (PeoplePropertyConfig) GetType ¶
func (p PeoplePropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the PeoplePropertyConfig.
type PhoneNumberProperty ¶
type PhoneNumberProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` PhoneNumber string `json:"phone_number"` }
PhoneNumberProperty is a type for phone number property.
func (PhoneNumberProperty) GetID ¶
func (p PhoneNumberProperty) GetID() string
GetID returns the ID of the PhoneNumberProperty.
func (PhoneNumberProperty) GetType ¶
func (p PhoneNumberProperty) GetType() PropertyType
GetType returns the Type of the PhoneNumberProperty.
type PhoneNumberPropertyConfig ¶
type PhoneNumberPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` PhoneNumber any `json:"phone_number"` }
PhoneNumberPropertyConfig is a type for phone number property configs.
func (PhoneNumberPropertyConfig) GetID ¶
func (p PhoneNumberPropertyConfig) GetID() PropertyID
GetID returns the ID of the PhoneNumberPropertyConfig.
func (PhoneNumberPropertyConfig) GetType ¶
func (p PhoneNumberPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the PhoneNumberPropertyConfig.s
type Properties ¶
Properties is a map of property.
func (*Properties) UnmarshalJSON ¶
func (p *Properties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements custom unmarshalling for Properties
type Property ¶
type Property interface { GetID() string GetType() PropertyType }
Property is an interface for Notion properties.
type PropertyArray ¶
type PropertyArray []Property
PropertyArray is a slice of Notion properties.
func (*PropertyArray) UnmarshalJSON ¶
func (arr *PropertyArray) UnmarshalJSON(data []byte) error
UnmarshalJSON implements custom unmarshalling for PropertyArray
type PropertyConfig ¶
type PropertyConfig interface { GetType() PropertyConfigType GetID() PropertyID }
PropertyConfig is an interface for property configs.
type PropertyConfigType ¶
type PropertyConfigType string
PropertyConfigType is a type for property config types.
const ( PropertyConfigTypeTitle PropertyConfigType = "title" PropertyConfigTypeRichText PropertyConfigType = "rich_text" PropertyConfigTypeNumber PropertyConfigType = "number" PropertyConfigTypeSelect PropertyConfigType = "select" PropertyConfigTypeMultiSelect PropertyConfigType = "multi_select" PropertyConfigTypeDate PropertyConfigType = "date" PropertyConfigTypePeople PropertyConfigType = "people" PropertyConfigTypeFiles PropertyConfigType = "files" PropertyConfigTypeCheckbox PropertyConfigType = "checkbox" PropertyConfigTypeURL PropertyConfigType = "url" PropertyConfigTypeEmail PropertyConfigType = "email" PropertyConfigTypePhoneNumber PropertyConfigType = "phone_number" PropertyConfigTypeFormula PropertyConfigType = "formula" PropertyConfigTypeRelation PropertyConfigType = "relation" PropertyConfigTypeRollup PropertyConfigType = "rollup" PropertyConfigCreatedTime PropertyConfigType = "created_time" PropertyConfigCreatedBy PropertyConfigType = "created_by" PropertyConfigLastEditedTime PropertyConfigType = "last_edited_time" PropertyConfigLastEditedBy PropertyConfigType = "last_edited_by" PropertyConfigStatus PropertyConfigType = "status" PropertyConfigUniqueID PropertyConfigType = "unique_id" PropertyConfigVerification PropertyConfigType = "verification" PropertyConfigButton PropertyConfigType = "button" )
nolint:revive
type PropertyConfigs ¶
type PropertyConfigs map[string]PropertyConfig
PropertyConfigs is a map of property configs.
func (*PropertyConfigs) UnmarshalJSON ¶
func (p *PropertyConfigs) UnmarshalJSON(data []byte) error
UnmarshalJSON implements custom unmarshalling for PropertyConfigs
type PropertyFilter ¶
type PropertyFilter struct { Property string `json:"property"` RichText *TextFilterCondition `json:"rich_text,omitempty"` Number *NumberFilterCondition `json:"number,omitempty"` Checkbox *CheckboxFilterCondition `json:"checkbox,omitempty"` Select *SelectFilterCondition `json:"select,omitempty"` MultiSelect *MultiSelectFilterCondition `json:"multi_select,omitempty"` Date *DateFilterCondition `json:"date,omitempty"` People *PeopleFilterCondition `json:"people,omitempty"` Files *FilesFilterCondition `json:"files,omitempty"` Relation *RelationFilterCondition `json:"relation,omitempty"` Formula *FormulaFilterCondition `json:"formula,omitempty"` Rollup *RollupFilterCondition `json:"rollup,omitempty"` Status *StatusFilterCondition `json:"status,omitempty"` UniqueID *UniqueIDFilterCondition `json:"unique_id,omitempty"` }
PropertyFilter is a type for property filters.
type PropertyID ¶
type PropertyID string
PropertyID is a type for property IDs.
func (PropertyID) String ¶
func (pID PropertyID) String() string
String returns the string representation of the PropertyID.
type PropertyType ¶
type PropertyType string
PropertyType is a type for Notion property types.
const ( PropertyTypeTitle PropertyType = "title" PropertyTypeRichText PropertyType = "rich_text" PropertyTypeText PropertyType = "text" PropertyTypeNumber PropertyType = "number" PropertyTypeSelect PropertyType = "select" PropertyTypeMultiSelect PropertyType = "multi_select" PropertyTypeDate PropertyType = "date" PropertyTypeFormula PropertyType = "formula" PropertyTypeRelation PropertyType = "relation" PropertyTypeRollup PropertyType = "rollup" PropertyTypePeople PropertyType = "people" PropertyTypeFiles PropertyType = "files" PropertyTypeCheckbox PropertyType = "checkbox" PropertyTypeURL PropertyType = "url" PropertyTypeEmail PropertyType = "email" PropertyTypePhoneNumber PropertyType = "phone_number" PropertyTypeCreatedTime PropertyType = "created_time" PropertyTypeCreatedBy PropertyType = "created_by" PropertyTypeLastEditedTime PropertyType = "last_edited_time" PropertyTypeLastEditedBy PropertyType = "last_edited_by" PropertyTypeStatus PropertyType = "status" PropertyTypeUniqueID PropertyType = "unique_id" PropertyTypeVerification PropertyType = "verification" PropertyTypeButton PropertyType = "button" )
nolint:revive
type Quote ¶
type Quote struct { AtomChildren RichText RichTexts `json:"rich_text"` Color string `json:"color,omitempty"` }
Quote is a type for quote blocks
type QuoteBlock ¶
type QuoteBlock struct { BasicBlock Quote Quote `json:"quote"` }
QuoteBlock is a Notion block for quote blocks
func (*QuoteBlock) AppendChildren ¶ added in v0.0.3
func (b *QuoteBlock) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*QuoteBlock) SetBasicBlock ¶ added in v0.0.3
func (b *QuoteBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*QuoteBlock) SetChildren ¶
func (b *QuoteBlock) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type RateLimitedError ¶
type RateLimitedError struct {
Message string
}
RateLimitedError is a type for rate-limited errors.
func (*RateLimitedError) Error ¶
func (e *RateLimitedError) Error() string
Error implements the error interface.
type RelationConfig ¶
type RelationConfig struct { DatabaseID DatabaseID `json:"database_id"` SyncedPropertyID PropertyID `json:"synced_property_id,omitempty"` SyncedPropertyName string `json:"synced_property_name,omitempty"` Type RelationConfigType `json:"type,omitempty"` SingleProperty *SingleProperty `json:"single_property,omitempty"` DualProperty *DualProperty `json:"dual_property,omitempty"` }
RelationConfig is a type for relation configs.
type RelationConfigType ¶
type RelationConfigType string
RelationConfigType is a type for relation config types.
const ( RelationSingleProperty RelationConfigType = "single_property" RelationDualProperty RelationConfigType = "dual_property" )
nolint:revive
func (RelationConfigType) String ¶
func (rp RelationConfigType) String() string
String returns the string representation of the RelationConfigType.
type RelationFilterCondition ¶
type RelationFilterCondition struct { Contains string `json:"contains,omitempty"` DoesNotContain string `json:"does_not_contain,omitempty"` IsEmpty bool `json:"is_empty,omitempty"` IsNotEmpty bool `json:"is_not_empty,omitempty"` }
RelationFilterCondition is a type for relation filter conditions.
type RelationObject ¶
type RelationObject struct { Database DatabaseID `json:"database"` SyncedPropertyName string `json:"synced_property_name"` }
RelationObject TODO: should be part of PropertyConfigs, right?
type RelationProperty ¶
type RelationProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Relation []Relation `json:"relation"` }
RelationProperty is a type for relation property.
func (RelationProperty) GetID ¶
func (p RelationProperty) GetID() string
GetID returns the ID of the RelationProperty.
func (RelationProperty) GetType ¶
func (p RelationProperty) GetType() PropertyType
GetType returns the Type of the RelationProperty.
type RelationPropertyConfig ¶
type RelationPropertyConfig struct { Type PropertyConfigType `json:"type"` Relation RelationConfig `json:"relation"` }
RelationPropertyConfig is a type for relation property configs.
func (RelationPropertyConfig) GetID ¶
func (p RelationPropertyConfig) GetID() PropertyID
GetID returns the ID of the RelationPropertyConfig.
func (RelationPropertyConfig) GetType ¶
func (p RelationPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the RelationPropertyConfig.
type RichText ¶
type RichText struct { Type RichTextType `json:"type,omitempty"` Text *Text `json:"text,omitempty"` Mention *Mention `json:"mention,omitempty"` Equation *Equation `json:"equation,omitempty"` Annotations *Annotations `json:"annotations,omitempty"` // PlainText is the Text.Content or Mention.{*Name*} or Equation.Expression PlainText string `json:"plain_text,omitempty"` // Href is the Text.Link.Url or Mention.{*Href*} Href string `json:"href,omitempty"` }
RichText is a rich text object
func NewDatabaseMentionRichText ¶ added in v0.0.3
NewDatabaseMentionRichText creates a new RichText with mention to the given database ID
func NewEquationBlock ¶
NewEquationBlock creates a new Equation block with the given equation expression
func NewEquationRichText ¶ added in v0.0.3
NewEquationRichText creates a new RichText with the given equation expression
func NewLinkRichText ¶
NewLinkRichText creates a new RichText with the given content and link It fully builds the RichText object with all fields populated.
func NewPageMentionRichText ¶ added in v0.0.3
NewPageMentionRichText creates a new RichText with mention to the given page ID
func NewTextRichText ¶
NewTextRichText creates a new RichText with the given text It fully builds the RichText object with all fields populated.
func NewUserMentionRichText ¶ added in v0.0.3
NewUserMentionRichText creates a new RichText with mention to the given user ID
func (RichText) WithColor ¶ added in v0.0.3
WithColor makes a new RichText annotated as colored text
func (RichText) WithItalic ¶ added in v0.0.3
WithItalic makes a new RichText annotated as italic text
func (RichText) WithLink ¶ added in v0.0.3
WithLink makes a new RichText with a link to the given destination
func (RichText) WithStrikethrough ¶ added in v0.0.3
WithStrikethrough makes a new RichText annotated as strikethrough text
func (RichText) WithUnderline ¶ added in v0.0.3
WithUnderline makes a new RichText annotated as underline text
type RichTextProperty ¶
type RichTextProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` RichText RichTexts `json:"rich_text"` }
RichTextProperty is a type for rich text property.
func (RichTextProperty) GetID ¶
func (p RichTextProperty) GetID() string
GetID returns the ID of the RichTextProperty.
func (RichTextProperty) GetType ¶
func (p RichTextProperty) GetType() PropertyType
GetType returns the Type of the RichTextProperty.
type RichTextPropertyConfig ¶
type RichTextPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` RichText any `json:"rich_text"` }
RichTextPropertyConfig is a type for rich text property configs.
func (RichTextPropertyConfig) GetID ¶
func (p RichTextPropertyConfig) GetID() PropertyID
GetID returns the ID of the RichTextPropertyConfig.
func (RichTextPropertyConfig) GetType ¶
func (p RichTextPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the RichTextPropertyConfig.
type RichTextType ¶
type RichTextType string
RichTextType is a type of a RichText
const ( RichTextTypeText RichTextType = "text" RichTextTypeMention RichTextType = "mention" RichTextTypeEquation RichTextType = "equation" )
nolint:revive
func (RichTextType) String ¶
func (t RichTextType) String() string
String returns the string representation of the RichTextType
type Rollup ¶
type Rollup struct { Type RollupType `json:"type,omitempty"` Number float64 `json:"number,omitempty"` Date *DateObject `json:"date,omitempty"` Array PropertyArray `json:"array,omitempty"` }
Rollup is a type for rollup.
type RollupConfig ¶
type RollupConfig struct { RelationPropertyName string `json:"relation_property_name"` RelationPropertyID PropertyID `json:"relation_property_id"` RollupPropertyName string `json:"rollup_property_name"` RollupPropertyID PropertyID `json:"rollup_property_id"` Function FunctionType `json:"function"` }
RollupConfig is a type for rollup configs.
type RollupFilterCondition ¶
type RollupFilterCondition struct { Any *RollupSubfilterCondition `json:"any,omitempty"` None *RollupSubfilterCondition `json:"none,omitempty"` Every *RollupSubfilterCondition `json:"every,omitempty"` Date *DateFilterCondition `json:"date,omitempty"` Number *NumberFilterCondition `json:"number,omitempty"` }
RollupFilterCondition is a type for rollup filter conditions.
type RollupProperty ¶
type RollupProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Rollup Rollup `json:"rollup"` }
RollupProperty is a type for rollup property.
func (RollupProperty) GetID ¶
func (p RollupProperty) GetID() string
GetID returns the ID of the RollupProperty.
func (RollupProperty) GetType ¶
func (p RollupProperty) GetType() PropertyType
GetType returns the Type of the RollupProperty.
type RollupPropertyConfig ¶
type RollupPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Rollup RollupConfig `json:"rollup"` }
RollupPropertyConfig is a type for rollup property configs.
func (RollupPropertyConfig) GetID ¶
func (p RollupPropertyConfig) GetID() PropertyID
GetID returns the ID of the RollupPropertyConfig.
func (RollupPropertyConfig) GetType ¶
func (p RollupPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the RollupPropertyConfig.
type RollupSubfilterCondition ¶
type RollupSubfilterCondition struct { RichText *TextFilterCondition `json:"rich_text,omitempty"` Number *NumberFilterCondition `json:"number,omitempty"` Checkbox *CheckboxFilterCondition `json:"checkbox,omitempty"` Select *SelectFilterCondition `json:"select,omitempty"` MultiSelect *MultiSelectFilterCondition `json:"multiSelect,omitempty"` Relation *RelationFilterCondition `json:"relation,omitempty"` Date *DateFilterCondition `json:"date,omitempty"` People *PeopleFilterCondition `json:"people,omitempty"` Files *FilesFilterCondition `json:"files,omitempty"` }
RollupSubfilterCondition is a type for rollup subfilter conditions.
type RollupType ¶
type RollupType string
RollupType is a type for rollup types.
const ( RollupTypeNumber RollupType = "number" RollupTypeDate RollupType = "date" RollupTypeArray RollupType = "array" )
nolint:revive
type SearchFilter ¶
SearchFilter is a type for search filters.
type SearchRequest ¶
type SearchRequest struct { // The text that the API compares page and database titles against. Query string `json:"query,omitempty"` // A set of criteria, direction and timestamp keys, that orders the results. // The only supported timestamp value is "last_edited_time". Supported // direction values are "ascending" and "descending". If sort is not provided, // then the most recently edited results are returned first. Sort *SortObject `json:"sort,omitempty"` // A set of criteria, value and property keys, that limits the results to // either only pages or only databases. Possible value values are "page" or // "database". The only supported property value is "object". Filter SearchFilter `json:"filter,omitempty"` // A cursor value returned in a previous response that If supplied, limits the // response to results starting after the cursor. If not supplied, then the // first page of results is returned. Refer to pagination for more details. StartCursor Cursor `json:"start_cursor,omitempty"` // The number of items from the full list to include in the response. Maximum: 100. PageSize int `json:"page_size,omitempty"` }
SearchRequest represents the request body for SearchClient.Do.
type SearchResponse ¶
type SearchResponse struct { AtomPaginatedResponse Results Objects `json:"results"` }
SearchResponse is a type for search response.
func (*SearchResponse) UnmarshalJSON ¶
func (sr *SearchResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements custom unmarshalling for SearchResponse
type SearchService ¶
type SearchService struct {
// contains filtered or unexported fields
}
SearchService is a service for the Search Notion API.
func (*SearchService) Do ¶
func (s *SearchService) Do(ctx context.Context, request *SearchRequest) (*SearchResponse, error)
Do searches all parent or child pages and databases that have been shared with an integration.
Returns all pages or databases, excluding duplicated linked databases, that have titles that include the query param. If no query param is provided, then the response contains all pages or databases that have been shared with the integration. The results adhere to any limitations related to an integration’s capabilities.
To limit the request to search only pages or to search only databases, use the filter param.
type Select ¶
type Select struct {
Options Options `json:"options"`
}
Select is a type for select configs.
type SelectFilterCondition ¶
type SelectFilterCondition struct { Equals string `json:"equals,omitempty"` DoesNotEqual string `json:"does_not_equal,omitempty"` IsEmpty bool `json:"is_empty,omitempty"` IsNotEmpty bool `json:"is_not_empty,omitempty"` }
SelectFilterCondition is a type for select filter conditions.
type SelectProperty ¶
type SelectProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Select Option `json:"select"` }
SelectProperty is a type for select property.
func (SelectProperty) GetID ¶
func (p SelectProperty) GetID() string
GetID returns the ID of the SelectProperty.
func (SelectProperty) GetType ¶
func (p SelectProperty) GetType() PropertyType
GetType returns the Type of the SelectProperty.
type SelectPropertyConfig ¶
type SelectPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Select Select `json:"select"` }
SelectPropertyConfig is a type for select property configs.
func (SelectPropertyConfig) GetID ¶
func (p SelectPropertyConfig) GetID() PropertyID
GetID returns the ID of the SelectPropertyConfig.
func (SelectPropertyConfig) GetType ¶
func (p SelectPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the SelectPropertyConfig.
type SortObject ¶
type SortObject struct { Property string `json:"property,omitempty"` Timestamp TimestampType `json:"timestamp,omitempty"` Direction SortOrder `json:"direction,omitempty"` }
SortObject is a type for sort object.
type StatusConfig ¶
type StatusConfig struct { Options Options `json:"options"` Groups []GroupConfig `json:"groups"` }
StatusConfig is a type for status configs.
type StatusFilterCondition ¶
type StatusFilterCondition struct { Equals string `json:"equals,omitempty"` DoesNotEqual string `json:"does_not_equal,omitempty"` IsEmpty bool `json:"is_empty,omitempty"` IsNotEmpty bool `json:"is_not_empty,omitempty"` }
StatusFilterCondition is a type for status filter conditions.
type StatusProperty ¶
type StatusProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Status Status `json:"status"` }
StatusProperty is a type for status property.
func (StatusProperty) GetID ¶
func (p StatusProperty) GetID() string
GetID returns the ID of the StatusProperty.
func (StatusProperty) GetType ¶
func (p StatusProperty) GetType() PropertyType
GetType returns the Type of the StatusProperty.
type StatusPropertyConfig ¶
type StatusPropertyConfig struct { ID PropertyID `json:"id"` Type PropertyConfigType `json:"type"` Status StatusConfig `json:"status"` }
StatusPropertyConfig is a type for status property configs.
func (StatusPropertyConfig) GetID ¶
func (p StatusPropertyConfig) GetID() PropertyID
GetID returns the ID of the StatusPropertyConfig.
func (StatusPropertyConfig) GetType ¶
func (p StatusPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the StatusPropertyConfig.
type Synced ¶
type Synced struct { AtomChildren // SyncedFrom is nil for the original block. SyncedFrom *SyncedFrom `json:"synced_from"` }
Synced is a type for synced blocks
type SyncedBlock ¶
type SyncedBlock struct { BasicBlock Synced Synced `json:"synced_block"` }
SyncedBlock is a Notion block for synced blocks
func NewSyncedBlock ¶
func NewSyncedBlock(s Synced) *SyncedBlock
NewSyncedBlock creates a new SyncedBlock
func (*SyncedBlock) AppendChildren ¶ added in v0.0.3
func (b *SyncedBlock) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*SyncedBlock) SetBasicBlock ¶ added in v0.0.3
func (b *SyncedBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*SyncedBlock) SetChildren ¶
func (b *SyncedBlock) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type SyncedFrom ¶
type SyncedFrom struct {
BlockID BlockID `json:"block_id"`
}
SyncedFrom holds the ID of the original block
type Table ¶
type Table struct { AtomChildren TableWidth int `json:"table_width"` HasColumnHeader bool `json:"has_column_header"` HasRowHeader bool `json:"has_row_header"` }
Table is a type for table blocks
type TableBlock ¶
type TableBlock struct { BasicBlock Table Table `json:"table"` }
TableBlock is a Notion block for table blocks
func NewTableBlock ¶
func NewTableBlock(table Table) *TableBlock
NewTableBlock creates a new TableBlock
func (*TableBlock) AppendChildren ¶ added in v0.0.3
func (b *TableBlock) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*TableBlock) SetBasicBlock ¶ added in v0.0.3
func (b *TableBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*TableBlock) SetChildren ¶
func (b *TableBlock) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type TableOfContents ¶
type TableOfContents struct { // empty Color string `json:"color,omitempty"` }
TableOfContents is a type for table of contents blocks
type TableOfContentsBlock ¶
type TableOfContentsBlock struct { BasicBlock TableOfContents TableOfContents `json:"table_of_contents"` }
TableOfContentsBlock is a Notion block for table of contents blocks
func NewTableOfContentsBlock ¶
func NewTableOfContentsBlock(toc TableOfContents) *TableOfContentsBlock
NewTableOfContentsBlock creates a new TableOfContentsBlock
func (*TableOfContentsBlock) SetBasicBlock ¶ added in v0.0.3
func (b *TableOfContentsBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type TableRow ¶
type TableRow struct {
Cells []RichTexts `json:"cells"`
}
TableRow is a type for table row blocks
type TableRowBlock ¶
type TableRowBlock struct { BasicBlock TableRow TableRow `json:"table_row"` }
TableRowBlock is a Notion block for table row blocks
func NewTableRowBlock ¶
func NewTableRowBlock(tr TableRow) *TableRowBlock
NewTableRowBlock creates a new TableRowBlock
func (*TableRowBlock) SetBasicBlock ¶ added in v0.0.3
func (b *TableRowBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type Template ¶
type Template struct { AtomChildren RichText RichTexts `json:"rich_text"` }
Template is a type for template blocks
type TemplateBlock ¶
type TemplateBlock struct { BasicBlock Template Template `json:"template"` }
TemplateBlock is a Notion block for template blocks Deprecated
func NewTemplateBlock ¶
func NewTemplateBlock(t Template) *TemplateBlock
NewTemplateBlock creates a new TemplateBlock Deprecated
func (*TemplateBlock) AppendChildren ¶ added in v0.0.3
func (b *TemplateBlock) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*TemplateBlock) SetBasicBlock ¶ added in v0.0.3
func (b *TemplateBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*TemplateBlock) SetChildren ¶
func (b *TemplateBlock) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type TemplateMention ¶
type TemplateMention struct { Type TemplateMentionType `json:"type"` TemplateMentionUser string `json:"template_mention_user,omitempty"` TemplateMentionDate string `json:"template_mention_date,omitempty"` }
TemplateMention is a template Mention object.
type TemplateMentionType ¶
type TemplateMentionType string
TemplateMentionType is a type of a template mention
const ( TemplateMentionTypeUser TemplateMentionType = "template_mention_user" TemplateMentionTypeDate TemplateMentionType = "template_mention_date" )
nolint:revive
func (TemplateMentionType) String ¶
func (t TemplateMentionType) String() string
String returns the string representation of the TemplateMentionType
type TextFilterCondition ¶
type TextFilterCondition struct { Equals string `json:"equals,omitempty"` DoesNotEqual string `json:"does_not_equal,omitempty"` Contains string `json:"contains,omitempty"` DoesNotContain string `json:"does_not_contain,omitempty"` StartsWith string `json:"starts_with,omitempty"` EndsWith string `json:"ends_with,omitempty"` IsEmpty bool `json:"is_empty,omitempty"` IsNotEmpty bool `json:"is_not_empty,omitempty"` }
TextFilterCondition is a type for text filter conditions.
type TextProperty ¶
type TextProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Text RichTexts `json:"text"` }
TextProperty is a type for text property.
func (TextProperty) GetID ¶
func (p TextProperty) GetID() string
GetID returns the ID of the TextProperty.
func (TextProperty) GetType ¶
func (p TextProperty) GetType() PropertyType
GetType returns the Type of the TextProperty.
type TimestampFilter ¶
type TimestampFilter struct { Timestamp TimestampType `json:"timestamp"` CreatedTime *DateFilterCondition `json:"created_time,omitempty"` LastEditedTime *DateFilterCondition `json:"last_edited_time,omitempty"` }
TimestampFilter is a type for timestamp filters.
type TimestampType ¶
type TimestampType string
TimestampType is a type for timestamp type.
const ( TimestampCreated TimestampType = "created_time" TimestampLastEdited TimestampType = "last_edited_time" )
nolint:revive
type TitleProperty ¶
type TitleProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Title RichTexts `json:"title"` }
TitleProperty is a type for title property.
func (TitleProperty) GetID ¶
func (p TitleProperty) GetID() string
GetID returns the ID of the TitleProperty.
func (TitleProperty) GetType ¶
func (p TitleProperty) GetType() PropertyType
GetType returns the Type of the TitleProperty.
type TitlePropertyConfig ¶
type TitlePropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Title any `json:"title"` }
TitlePropertyConfig is a type for title property configs.
func (TitlePropertyConfig) GetID ¶
func (p TitlePropertyConfig) GetID() PropertyID
GetID returns the ID of the TitlePropertyConfig.
func (TitlePropertyConfig) GetType ¶
func (p TitlePropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the TitlePropertyConfig.
type ToDo ¶
type ToDo struct { AtomChildren RichText RichTexts `json:"rich_text"` Checked bool `json:"checked"` Color string `json:"color,omitempty"` }
ToDo is a type for to-do blocks
type ToDoBlock ¶
type ToDoBlock struct { BasicBlock ToDo ToDo `json:"to_do"` }
ToDoBlock is a Notion block for to-do blocks
func (*ToDoBlock) AppendChildren ¶ added in v0.0.3
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*ToDoBlock) SetBasicBlock ¶ added in v0.0.3
func (b *ToDoBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*ToDoBlock) SetChildren ¶
SetChildren calls inner .SetChildren + updates the HasChildren field
type Toggle ¶
type Toggle struct { AtomChildren RichText RichTexts `json:"rich_text"` Color string `json:"color,omitempty"` }
Toggle is a type for toggle blocks
type ToggleBlock ¶
type ToggleBlock struct { BasicBlock Toggle Toggle `json:"toggle"` }
ToggleBlock is a Notion block for toggle blocks
func NewToggleBlock ¶
func NewToggleBlock(t Toggle) *ToggleBlock
NewToggleBlock creates a new ToggleBlock
func (*ToggleBlock) AppendChildren ¶ added in v0.0.3
func (b *ToggleBlock) AppendChildren(children ...Block)
AppendChildren calls inner .AppendChildren + updates the HasChildren field
func (*ToggleBlock) SetBasicBlock ¶ added in v0.0.3
func (b *ToggleBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
func (*ToggleBlock) SetChildren ¶
func (b *ToggleBlock) SetChildren(children Blocks)
SetChildren calls inner .SetChildren + updates the HasChildren field
type TokenCreateError ¶
type TokenCreateError struct { Code ErrorCode `json:"error"` Message string `json:"error_description"` }
TokenCreateError is a type for token creation errors.
func (*TokenCreateError) Error ¶
func (e *TokenCreateError) Error() string
Error implements the error interface.
type TokenCreateRequest ¶
type TokenCreateRequest struct { // A unique random code that Notion generates to authenticate with your service, // generated when a user initiates the OAuth flow. Code string `json:"code"` // A constant string: "authorization_code". GrantType string `json:"grant_type"` // The "redirect_uri" that was provided in the OAuth Domain & URI section of // the integration's Authorization settings. Do not include this field if a // "redirect_uri" query param was not included in the Authorization URL // provided to users. In most cases, this field is required. RedirectURI string `json:"redirect_uri,omitempty"` // Required if and only when building Link Preview integrations (otherwise // ignored). An object with key and name properties. key should be a unique // identifier for the account. Notion uses the key to determine whether or not // the user is re-connecting the same account. name should be some way for the // user to know which account they used to authenticate with your service. If // a user has authenticated Notion with your integration before and key is the // same but name is different, then Notion updates the name associated with // your integration. ExternalAccount ExternalAccount `json:"external_account,omitempty"` }
TokenCreateRequest represents the request body for AuthenticationClient.CreateToken.
type TokenCreateResponse ¶
type TokenCreateResponse struct { AccessToken string `json:"access_token"` BotID string `json:"bot_id"` DuplicatedTemplateID string `json:"duplicated_template_id,omitempty"` // Owner can be { "workspace": true } OR a User object. // Ref: https://developers.notion.com/docs/authorization#step-4-notion-responds-with-an-access_token-and-some-additional-information Owner any `json:"owner,omitempty"` WorkspaceIcon string `json:"workspace_icon"` WorkspaceID string `json:"workspace_id"` WorkspaceName string `json:"workspace_name"` }
TokenCreateResponse is a type for token create response.
type URLProperty ¶
type URLProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` URL string `json:"url"` }
URLProperty is a type for URL property.
func (URLProperty) GetID ¶
func (p URLProperty) GetID() string
GetID returns the ID of the URLProperty.
func (URLProperty) GetType ¶
func (p URLProperty) GetType() PropertyType
GetType returns the Type of the URLProperty.
type URLPropertyConfig ¶
type URLPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` URL any `json:"url"` }
URLPropertyConfig is a type for URL property configs.
func (URLPropertyConfig) GetID ¶
func (p URLPropertyConfig) GetID() PropertyID
GetID returns the ID of the URLPropertyConfig.
func (URLPropertyConfig) GetType ¶
func (p URLPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the URLPropertyConfig.
type UniqueIDConfig ¶
type UniqueIDConfig struct {
Prefix string `json:"prefix"`
}
UniqueIDConfig is a type for unique ID configs.
type UniqueIDFilterCondition ¶ added in v0.0.3
type UniqueIDFilterCondition struct { Equals *int `json:"equals,omitempty"` DoesNotEqual *int `json:"does_not_equal,omitempty"` GreaterThan *int `json:"greater_than,omitempty"` LessThan *int `json:"less_than,omitempty"` GreaterThanOrEqualTo *int `json:"greater_than_or_equal_to,omitempty"` LessThanOrEqualTo *int `json:"less_than_or_equal_to,omitempty"` }
UniqueIDFilterCondition is a type for unique ID filter conditions.
type UniqueIDProperty ¶
type UniqueIDProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` UniqueID UniqueID `json:"unique_id"` }
UniqueIDProperty is a type for unique ID property.
func (UniqueIDProperty) GetID ¶
func (p UniqueIDProperty) GetID() string
GetID returns the ID of the UniqueIDProperty.
func (UniqueIDProperty) GetType ¶
func (p UniqueIDProperty) GetType() PropertyType
GetType returns the Type of the UniqueIDProperty.
type UniqueIDPropertyConfig ¶
type UniqueIDPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` UniqueID UniqueIDConfig `json:"unique_id"` }
UniqueIDPropertyConfig is a type for unique ID property configs.
func (UniqueIDPropertyConfig) GetID ¶
func (p UniqueIDPropertyConfig) GetID() PropertyID
GetID returns the ID of the UniqueIDPropertyConfig.
func (UniqueIDPropertyConfig) GetType ¶
func (p UniqueIDPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the UniqueIDPropertyConfig.
type UnsupportedBlock ¶
type UnsupportedBlock struct {
BasicBlock
}
UnsupportedBlock is a Notion block for unsupported blocks
func NewUnsupportedBlock ¶ added in v0.0.3
func NewUnsupportedBlock() *UnsupportedBlock
NewUnsupportedBlock creates a new UnsupportedBlock
func (*UnsupportedBlock) SetBasicBlock ¶ added in v0.0.3
func (b *UnsupportedBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
type User ¶
type User struct { AtomObject AtomID Type UserType `json:"type,omitempty"` Name string `json:"name,omitempty"` AvatarURL string `json:"avatar_url,omitempty"` Person *Person `json:"person,omitempty"` Bot *Bot `json:"bot,omitempty"` }
User is a Notion object that represents a user.
func NewBotUser ¶ added in v0.0.3
NewBotUser returns a new User(Bot) with the given ID and Bot instance.
func NewPersonUser ¶ added in v0.0.3
NewPersonUser returns a new User(Person) with the given ID and email.
type UserID ¶
type UserID = ObjectID
UserID stands for ID of User object. User is an Object, so UserID is just an alias for Object
type UserMention ¶ added in v0.0.3
type UserMention struct { Object ObjectType `json:"object"` // always "user" ID ObjectID `json:"id"` }
UserMention is a user mention object
type UsersListResponse ¶
type UsersListResponse struct { Object ObjectType `json:"object"` Results Users `json:"results"` HasMore bool `json:"has_more"` NextCursor Cursor `json:"next_cursor"` }
UsersListResponse stands for a paginated list of Users.
type UsersService ¶ added in v0.0.3
type UsersService struct {
// contains filtered or unexported fields
}
UsersService is a service for Notion Users API.
func (*UsersService) List ¶ added in v0.0.3
func (s *UsersService) List(ctx context.Context, pagination *Pagination) (*UsersListResponse, error)
List returns a paginated list of Users for the workspace. The response may containf fewer than page_size of results.
type Verification ¶
type Verification struct { State VerificationState `json:"state"` VerifiedBy *User `json:"verified_by,omitempty"` Date *DateObject `json:"date,omitempty"` }
Verification documented here: https://developers.notion.com/reference/page-property-values#verification
type VerificationProperty ¶
type VerificationProperty struct { ID ObjectID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Verification Verification `json:"verification"` }
VerificationProperty is a type for verification property.
func (VerificationProperty) GetID ¶
func (p VerificationProperty) GetID() string
GetID returns the ID of the VerificationProperty.
func (VerificationProperty) GetType ¶
func (p VerificationProperty) GetType() PropertyType
GetType returns the Type of the VerificationProperty.
type VerificationPropertyConfig ¶
type VerificationPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type,omitempty"` Verification Verification `json:"verification"` }
VerificationPropertyConfig is a type for verification property configs.
func (VerificationPropertyConfig) GetID ¶
func (p VerificationPropertyConfig) GetID() PropertyID
GetID returns the ID of the VerificationPropertyConfig.
func (VerificationPropertyConfig) GetType ¶
func (p VerificationPropertyConfig) GetType() PropertyConfigType
GetType returns the Type of the VerificationPropertyConfig.
type VerificationState ¶
type VerificationState string
VerificationState is a type for verification states.
const ( VerificationStateVerified VerificationState = "verified" VerificationStateUnverified VerificationState = "unverified" )
nolint:revive
func (VerificationState) String ¶
func (vs VerificationState) String() string
String returns the string representation of the VerificationState.
type VideoBlock ¶
type VideoBlock struct { BasicBlock Video File `json:"video"` }
VideoBlock is a Notion block for video files
func NewVideoBlock ¶
func NewVideoBlock(video File) *VideoBlock
NewVideoBlock creates a new VideoBlock
func (*VideoBlock) GetExpiryTime ¶ added in v0.0.3
func (b *VideoBlock) GetExpiryTime() *time.Time
GetExpiryTime implements Media interface for VideoBlock
func (*VideoBlock) GetURL ¶ added in v0.0.3
func (b *VideoBlock) GetURL() string
GetURL implements Media interface for VideoBlock
func (*VideoBlock) SetBasicBlock ¶ added in v0.0.3
func (b *VideoBlock) SetBasicBlock(block BasicBlock) Block
SetBasicBlock implements the SetBasicBlock method of the BasicBlockHolder interface.
Source Files
¶
- block_bookmark.go
- block_breadcrumb.go
- block_callout.go
- block_child_database.go
- block_child_page.go
- block_code.go
- block_column.go
- block_column_list.go
- block_divider.go
- block_embed.go
- block_equation.go
- block_headings.go
- block_link_preview.go
- block_link_to_page.go
- block_list_item.go
- block_media.go
- block_paragraph.go
- block_quote.go
- block_richtext.go
- block_richtext_equation.go
- block_richtext_mention.go
- block_richtext_text.go
- block_synced.go
- block_table.go
- block_table_of_contents.go
- block_template.go
- block_todo.go
- block_toggle.go
- block_unsupported.go
- client.go
- client_api.go
- doc.go
- misc_appearance.go
- misc_color.go
- misc_date.go
- misc_error.go
- misc_filter.go
- misc_pagination.go
- misc_property_config.go
- misc_sort.go
- object.go
- object_atoms.go
- object_block.go
- object_comment.go
- object_database.go
- object_embedded_emoji.go
- object_embedded_file.go
- object_embedded_parent.go
- object_page.go
- object_property_item.go
- object_user.go
- service_authentication.go
- service_blocks.go
- service_comments.go
- service_databases.go
- service_pages.go
- service_search.go
- service_users.go
Directories
¶
Path | Synopsis |
---|---|
x
|
|
notionast
Package notionast provides a set of functions to work with Notion AST It is used to convert notion.Blocks to AST and vice versa It also provides Walk functionality to traverse the AST.
|
Package notionast provides a set of functions to work with Notion AST It is used to convert notion.Blocks to AST and vice versa It also provides Walk functionality to traverse the AST. |