Documentation
¶
Index ¶
- type AndCompoundFilter
- type Annotations
- type AppendBlockChildrenRequest
- type AppendBlockChildrenResponse
- type Audio
- type AudioBlock
- type AuthenticationClient
- type AuthenticationService
- type BasicBlock
- func (b BasicBlock) GetArchived() bool
- func (b BasicBlock) GetCreatedBy() *User
- func (b BasicBlock) GetCreatedTime() *time.Time
- func (b BasicBlock) GetHasChildren() bool
- func (b BasicBlock) GetID() BlockID
- func (b BasicBlock) GetLastEditedBy() *User
- func (b BasicBlock) GetLastEditedTime() *time.Time
- func (b BasicBlock) GetObject() ObjectType
- func (b BasicBlock) GetType() BlockType
- type Block
- type BlockClient
- func (bc *BlockClient) AppendChildren(ctx context.Context, id BlockID, requestBody *AppendBlockChildrenRequest) (*AppendBlockChildrenResponse, error)
- func (bc *BlockClient) Delete(ctx context.Context, id BlockID) (Block, error)
- func (bc *BlockClient) Get(ctx context.Context, id BlockID) (Block, error)
- func (bc *BlockClient) GetChildren(ctx context.Context, id BlockID, pagination *Pagination) (*GetChildrenResponse, error)
- func (bc *BlockClient) Update(ctx context.Context, id BlockID, requestBody *BlockUpdateRequest) (Block, error)
- type BlockFile
- type BlockID
- type BlockService
- type BlockType
- type BlockUpdateRequest
- type Blocks
- type Bookmark
- type BookmarkBlock
- type Bot
- type Breadcrumb
- type BreadcrumbBlock
- type BulletedListItemBlock
- type Callout
- type CalloutBlock
- type CheckboxFilterCondition
- type CheckboxProperty
- type CheckboxPropertyConfig
- type ChildDatabaseBlock
- type ChildPageBlock
- type Client
- type ClientOption
- type Code
- type CodeBlock
- type Color
- type Column
- type ColumnBlock
- type ColumnList
- type ColumnListBlock
- type Comment
- type CommentClient
- type CommentCreateRequest
- type CommentID
- type CommentQueryResponse
- type CommentService
- type CompoundFilter
- type Condition
- type CreatedByProperty
- type CreatedByPropertyConfig
- type CreatedTimeProperty
- type CreatedTimePropertyConfig
- type Cursor
- type Database
- type DatabaseClient
- func (dc *DatabaseClient) Create(ctx context.Context, requestBody *DatabaseCreateRequest) (*Database, error)
- func (dc *DatabaseClient) Get(ctx context.Context, id DatabaseID) (*Database, error)
- func (dc *DatabaseClient) Query(ctx context.Context, id DatabaseID, requestBody *DatabaseQueryRequest) (*DatabaseQueryResponse, error)
- func (dc *DatabaseClient) Update(ctx context.Context, id DatabaseID, requestBody *DatabaseUpdateRequest) (*Database, error)
- type DatabaseCreateRequest
- type DatabaseID
- type DatabaseListResponse
- type DatabaseMention
- type DatabaseQueryRequest
- type DatabaseQueryResponse
- type DatabaseService
- type DatabaseUpdateRequest
- type Date
- type DateFilterCondition
- type DateObject
- type DateProperty
- type DatePropertyConfig
- type DiscussionID
- type Divider
- type DividerBlock
- type EmailProperty
- type EmailPropertyConfig
- type Embed
- type EmbedBlock
- type Emoji
- type Equation
- type EquationBlock
- type Error
- type ErrorCode
- type ExternalAccount
- type File
- type FileBlock
- type FileObject
- type FileType
- 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 Heading
- type Heading1Block
- type Heading2Block
- type Heading3Block
- type Icon
- type Image
- type ImageBlock
- type LastEditedByProperty
- type LastEditedByPropertyConfig
- type LastEditedTimeProperty
- type LastEditedTimePropertyConfig
- type Link
- type LinkPreview
- type LinkPreviewBlock
- type LinkToPage
- type LinkToPageBlock
- type ListItem
- 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 Option
- type OrCompoundFilter
- type Owner
- type Page
- type PageClient
- type PageCreateRequest
- type PageID
- type PageMention
- type PageService
- type PageUpdateRequest
- type Pagination
- type Paragraph
- type ParagraphBlock
- type Parent
- type ParentType
- type Pdf
- 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 RelationFilterCondition
- type RelationObject
- type RelationProperty
- type RelationPropertyConfig
- type RichText
- type RichTextProperty
- type RichTextPropertyConfig
- type Rollup
- type RollupConfig
- type RollupFilterCondition
- type RollupProperty
- type RollupPropertyConfig
- type RollupSubfilterCondition
- type RollupType
- type SearchClient
- type SearchFilter
- type SearchRequest
- type SearchResponse
- type SearchService
- type Select
- type SelectFilterCondition
- type SelectProperty
- type SelectPropertyConfig
- type SortObject
- type SortOrder
- type Status
- 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 TokenCreateRequest
- type TokenCreateResponse
- type URLProperty
- type URLPropertyConfig
- type UnsupportedBlock
- type User
- type UserClient
- type UserID
- type UserService
- type UserType
- type UsersListResponse
- type Video
- type VideoBlock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AndCompoundFilter ¶
type AndCompoundFilter []Filter
func (AndCompoundFilter) MarshalJSON ¶
func (f AndCompoundFilter) MarshalJSON() ([]byte, error)
type Annotations ¶
type AppendBlockChildrenRequest ¶
type AppendBlockChildrenRequest struct {
Children []Block `json:"children"`
}
type AppendBlockChildrenResponse ¶
type AppendBlockChildrenResponse struct { Object ObjectType `json:"object"` Results []Block `json:"results"` }
func (*AppendBlockChildrenResponse) UnmarshalJSON ¶
func (r *AppendBlockChildrenResponse) UnmarshalJSON(data []byte) error
type Audio ¶
type Audio struct { Caption []RichText `json:"caption,omitempty"` Type FileType `json:"type"` File *FileObject `json:"file,omitempty"` External *FileObject `json:"external,omitempty"` }
type AudioBlock ¶
type AudioBlock struct { BasicBlock Audio Audio `json:"audio"` }
type AuthenticationClient ¶
type AuthenticationClient struct {
// contains filtered or unexported fields
}
func (*AuthenticationClient) CreateToken ¶
func (cc *AuthenticationClient) CreateToken(ctx context.Context, request *TokenCreateRequest) (*TokenCreateResponse, error)
Create https://developers.notion.com/reference/create-a-token
type AuthenticationService ¶
type AuthenticationService interface {
CreateToken(ctx context.Context, request *TokenCreateRequest) (*TokenCreateResponse, error)
}
type BasicBlock ¶
type BasicBlock struct { Object ObjectType `json:"object"` ID BlockID `json:"id,omitempty"` Type BlockType `json:"type"` CreatedTime *time.Time `json:"created_time,omitempty"` LastEditedTime *time.Time `json:"last_edited_time,omitempty"` CreatedBy *User `json:"created_by,omitempty"` LastEditedBy *User `json:"last_edited_by,omitempty"` HasChildren bool `json:"has_children,omitempty"` Archived bool `json:"archived,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 (BasicBlock) GetArchived ¶
func (b BasicBlock) GetArchived() bool
func (BasicBlock) GetCreatedBy ¶
func (b BasicBlock) GetCreatedBy() *User
func (BasicBlock) GetCreatedTime ¶
func (b BasicBlock) GetCreatedTime() *time.Time
func (BasicBlock) GetHasChildren ¶
func (b BasicBlock) GetHasChildren() bool
func (BasicBlock) GetID ¶
func (b BasicBlock) GetID() BlockID
func (BasicBlock) GetLastEditedBy ¶
func (b BasicBlock) GetLastEditedBy() *User
func (BasicBlock) GetLastEditedTime ¶
func (b BasicBlock) GetLastEditedTime() *time.Time
func (BasicBlock) GetObject ¶
func (b BasicBlock) GetObject() ObjectType
func (BasicBlock) GetType ¶
func (b BasicBlock) GetType() BlockType
type BlockClient ¶
type BlockClient struct {
// contains filtered or unexported fields
}
func (*BlockClient) AppendChildren ¶
func (bc *BlockClient) AppendChildren(ctx context.Context, id BlockID, requestBody *AppendBlockChildrenRequest) (*AppendBlockChildrenResponse, error)
AppendChildren https://developers.notion.com/reference/patch-block-children
func (*BlockClient) Delete ¶
Delete https://developers.notion.com/reference/delete-a-block
func (*BlockClient) Get ¶
Get https://developers.notion.com/reference/retrieve-a-block NOTE: If the block has children, it will not retrieve those children.
func (*BlockClient) GetChildren ¶
func (bc *BlockClient) GetChildren(ctx context.Context, id BlockID, pagination *Pagination) (*GetChildrenResponse, error)
GetChildren https://developers.notion.com/reference/get-block-children NOTE: For blocks with their own children, the Children slice will not be populated, instead the HasChildren flag will be true.
func (*BlockClient) Update ¶
func (bc *BlockClient) Update(ctx context.Context, id BlockID, requestBody *BlockUpdateRequest) (Block, error)
type BlockFile ¶
type BlockFile struct { Caption []RichText `json:"caption,omitempty"` Type FileType `json:"type"` File *FileObject `json:"file,omitempty"` External *FileObject `json:"external,omitempty"` }
type BlockService ¶
type BlockService interface { GetChildren(context.Context, BlockID, *Pagination) (*GetChildrenResponse, error) AppendChildren(context.Context, BlockID, *AppendBlockChildrenRequest) (*AppendBlockChildrenResponse, error) Get(context.Context, BlockID) (Block, error) Delete(context.Context, BlockID) (Block, error) Update(ctx context.Context, id BlockID, request *BlockUpdateRequest) (Block, error) }
type BlockType ¶
type BlockType string
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" BlockTypeVideo BlockType = "video" BlockTypeFile BlockType = "file" BlockTypePdf BlockType = "pdf" BlockTypeBookmark BlockType = "bookmark" BlockTypeCode BlockType = "code" BlockTypeDivider BlockType = "divider" BlockCallout BlockType = "callout" BlockQuote 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" BlockTypeTemplate BlockType = "template" BlockTypeSyncedBlock BlockType = "synced_block" BlockTypeTableBlock BlockType = "table" BlockTypeTableRowBlock BlockType = "table_row" BlockTypeUnsupported BlockType = "unsupported" )
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 *Image `json:"image,omitempty"` Video *Video `json:"video,omitempty"` File *BlockFile `json:"file,omitempty"` Pdf *Pdf `json:"pdf,omitempty"` Bookmark *Bookmark `json:"bookmark,omitempty"` Template *Template `json:"template,omitempty"` Callout *Callout `json:"callout,omitempty"` }
type BookmarkBlock ¶
type BookmarkBlock struct { BasicBlock Bookmark Bookmark `json:"bookmark"` }
type Breadcrumb ¶
type Breadcrumb struct { }
type BreadcrumbBlock ¶
type BreadcrumbBlock struct { BasicBlock Breadcrumb Breadcrumb `json:"breadcrumb"` }
type BulletedListItemBlock ¶
type BulletedListItemBlock struct { BasicBlock BulletedListItem ListItem `json:"bulleted_list_item"` }
type CalloutBlock ¶
type CalloutBlock struct { BasicBlock Callout Callout `json:"callout"` }
type CheckboxFilterCondition ¶
type CheckboxProperty ¶
type CheckboxProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Checkbox bool `json:"checkbox"` }
func (CheckboxProperty) GetID ¶
func (p CheckboxProperty) GetID() PropertyID
func (CheckboxProperty) GetType ¶
func (p CheckboxProperty) GetType() PropertyType
type CheckboxPropertyConfig ¶
type CheckboxPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Checkbox struct{} `json:"checkbox"` }
func (CheckboxPropertyConfig) GetID ¶
func (p CheckboxPropertyConfig) GetID() PropertyID
func (CheckboxPropertyConfig) GetType ¶
func (p CheckboxPropertyConfig) GetType() PropertyConfigType
type ChildDatabaseBlock ¶
type ChildDatabaseBlock struct { BasicBlock ChildDatabase struct { Title string `json:"title"` } `json:"child_database"` }
type ChildPageBlock ¶
type ChildPageBlock struct { BasicBlock ChildPage struct { Title string `json:"title"` } `json:"child_page"` }
type Client ¶
type Client struct { Token Token Database DatabaseService Block BlockService Page PageService User UserService Search SearchService Comment CommentService Authentication AuthenticationService // contains filtered or unexported fields }
func NewClient ¶
func NewClient(token Token, opts ...ClientOption) *Client
type ClientOption ¶
type ClientOption func(*Client)
ClientOption to configure API client
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ClientOption
WithHTTPClient overrides the default http.Client
func WithRetry ¶
func WithRetry(retries int) ClientOption
WithRetry overrides the default number of max retry attempts on 429 errors
func WithVersion ¶
func WithVersion(version string) ClientOption
WithVersion overrides the Notion API version
type CodeBlock ¶
type CodeBlock struct { BasicBlock Code Code `json:"code"` }
type Color ¶
type Color string
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" )
func (Color) MarshalText ¶
type Column ¶
type Column struct { // Children should at least have 1 block when appending. Children Blocks `json:"children"` }
type ColumnBlock ¶
type ColumnBlock struct { BasicBlock Column Column `json:"column"` }
type ColumnList ¶
type ColumnList struct { // Children can only contain column blocks // Children should have at least 2 blocks when appending. Children Blocks `json:"children"` }
type ColumnListBlock ¶
type ColumnListBlock struct { BasicBlock ColumnList ColumnList `json:"column_list"` }
type Comment ¶
type Comment struct { Object ObjectType `json:"object"` ID ObjectID `json:"id"` DiscussionID DiscussionID `json:"discussion_id"` CreatedTime time.Time `json:"created_time"` LastEditedTime time.Time `json:"last_edited_time"` CreatedBy User `json:"created_by,omitempty"` RichText []RichText `json:"rich_text"` Parent Parent `json:"parent"` }
type CommentClient ¶
type CommentClient struct {
// contains filtered or unexported fields
}
func (*CommentClient) Create ¶
func (cc *CommentClient) Create(ctx context.Context, requestBody *CommentCreateRequest) (*Comment, error)
Create https://developers.notion.com/reference/create-a-comment
func (*CommentClient) Get ¶
func (cc *CommentClient) Get(ctx context.Context, id BlockID, pagination *Pagination) (*CommentQueryResponse, error)
Get https://developers.notion.com/reference/retrieve-a-comment
type CommentCreateRequest ¶
type CommentCreateRequest struct { Parent Parent `json:"parent,omitempty"` DiscussionID DiscussionID `json:"discussion_id,omitempty"` RichText []RichText `json:"rich_text"` }
type CommentQueryResponse ¶
type CommentQueryResponse struct { Object ObjectType `json:"object"` Results []Comment `json:"results"` HasMore bool `json:"has_more"` NextCursor Cursor `json:"next_cursor"` }
type CommentService ¶
type CommentService interface { Get(context.Context, BlockID, *Pagination) (*CommentQueryResponse, error) Create(ctx context.Context, request *CommentCreateRequest) (*Comment, error) }
type CompoundFilter ¶
type CompoundFilter map[FilterOperator][]PropertyFilter
type Condition ¶
type Condition string
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" )
type CreatedByProperty ¶
type CreatedByProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` CreatedBy User `json:"created_by"` }
func (CreatedByProperty) GetID ¶
func (p CreatedByProperty) GetID() PropertyID
func (CreatedByProperty) GetType ¶
func (p CreatedByProperty) GetType() PropertyType
type CreatedByPropertyConfig ¶
type CreatedByPropertyConfig struct { ID PropertyID `json:"id"` Type PropertyConfigType `json:"type"` CreatedBy struct{} `json:"created_by"` }
func (CreatedByPropertyConfig) GetID ¶ added in v1.2.2
func (p CreatedByPropertyConfig) GetID() PropertyID
func (CreatedByPropertyConfig) GetType ¶
func (p CreatedByPropertyConfig) GetType() PropertyConfigType
type CreatedTimeProperty ¶
type CreatedTimeProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` CreatedTime time.Time `json:"created_time"` }
func (CreatedTimeProperty) GetID ¶
func (p CreatedTimeProperty) GetID() PropertyID
func (CreatedTimeProperty) GetType ¶
func (p CreatedTimeProperty) GetType() PropertyType
type CreatedTimePropertyConfig ¶
type CreatedTimePropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` CreatedTime struct{} `json:"created_time"` }
func (CreatedTimePropertyConfig) GetID ¶
func (p CreatedTimePropertyConfig) GetID() PropertyID
func (CreatedTimePropertyConfig) GetType ¶
func (p CreatedTimePropertyConfig) GetType() PropertyConfigType
type Database ¶
type Database struct { Object ObjectType `json:"object"` ID ObjectID `json:"id"` CreatedTime time.Time `json:"created_time"` LastEditedTime time.Time `json:"last_edited_time"` CreatedBy User `json:"created_by,omitempty"` LastEditedBy User `json:"last_edited_by,omitempty"` Title []RichText `json:"title"` Parent Parent `json:"parent"` URL string `json:"url"` // Properties is a map of property configurations that defines what Page.Properties each page of the database can use Properties PropertyConfigs `json:"properties"` Description []RichText `json:"description"` IsInline bool `json:"is_inline"` Archived bool `json:"archived"` Icon *Icon `json:"icon,omitempty"` Cover *Image `json:"cover,omitempty"` }
func (*Database) GetObject ¶
func (db *Database) GetObject() ObjectType
type DatabaseClient ¶
type DatabaseClient struct {
// contains filtered or unexported fields
}
func (*DatabaseClient) Create ¶
func (dc *DatabaseClient) Create(ctx context.Context, requestBody *DatabaseCreateRequest) (*Database, error)
Create https://developers.notion.com/reference/create-a-database
func (*DatabaseClient) Get ¶
func (dc *DatabaseClient) Get(ctx context.Context, id DatabaseID) (*Database, error)
func (*DatabaseClient) Query ¶
func (dc *DatabaseClient) Query(ctx context.Context, id DatabaseID, requestBody *DatabaseQueryRequest) (*DatabaseQueryResponse, error)
Query https://developers.notion.com/reference/post-database-query
func (*DatabaseClient) Update ¶
func (dc *DatabaseClient) Update(ctx context.Context, id DatabaseID, requestBody *DatabaseUpdateRequest) (*Database, error)
Update https://developers.notion.com/reference/update-a-database
type DatabaseCreateRequest ¶
type DatabaseCreateRequest struct { Parent Parent `json:"parent"` Title []RichText `json:"title"` Properties PropertyConfigs `json:"properties"` }
type DatabaseID ¶
type DatabaseID string
func (DatabaseID) String ¶
func (dID DatabaseID) String() string
type DatabaseListResponse ¶
type DatabaseListResponse struct { Object ObjectType `json:"object"` Results []Database `json:"results"` NextCursor string `json:"next_cursor"` HasMore bool `json:"has_more"` }
type DatabaseMention ¶
type DatabaseMention struct {
ID ObjectID `json:"id"`
}
type DatabaseQueryRequest ¶
type DatabaseQueryRequest struct { Filter Filter Sorts []SortObject `json:"sorts,omitempty"` StartCursor Cursor `json:"start_cursor,omitempty"` PageSize int `json:"page_size,omitempty"` }
func (*DatabaseQueryRequest) MarshalJSON ¶
func (qr *DatabaseQueryRequest) MarshalJSON() ([]byte, error)
type DatabaseQueryResponse ¶
type DatabaseQueryResponse struct { Object ObjectType `json:"object"` Results []Page `json:"results"` HasMore bool `json:"has_more"` NextCursor Cursor `json:"next_cursor"` }
type DatabaseService ¶
type DatabaseService interface { Get(context.Context, DatabaseID) (*Database, error) Query(context.Context, DatabaseID, *DatabaseQueryRequest) (*DatabaseQueryResponse, error) Update(context.Context, DatabaseID, *DatabaseUpdateRequest) (*Database, error) Create(ctx context.Context, request *DatabaseCreateRequest) (*Database, error) }
type DatabaseUpdateRequest ¶
type DatabaseUpdateRequest struct { Title []RichText `json:"title,omitempty"` Properties PropertyConfigs `json:"properties,omitempty"` }
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"` }
type DateObject ¶
type DateProperty ¶
type DateProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Date *DateObject `json:"date"` }
func (DateProperty) GetID ¶
func (p DateProperty) GetID() PropertyID
func (DateProperty) GetType ¶
func (p DateProperty) GetType() PropertyType
type DatePropertyConfig ¶
type DatePropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Date struct{} `json:"date"` }
func (DatePropertyConfig) GetID ¶
func (p DatePropertyConfig) GetID() PropertyID
func (DatePropertyConfig) GetType ¶
func (p DatePropertyConfig) GetType() PropertyConfigType
type DiscussionID ¶
type DiscussionID string
func (DiscussionID) String ¶
func (dID DiscussionID) String() string
type DividerBlock ¶
type DividerBlock struct { BasicBlock Divider Divider `json:"divider"` }
type EmailProperty ¶
type EmailProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Email string `json:"email"` }
func (EmailProperty) GetID ¶
func (p EmailProperty) GetID() PropertyID
func (EmailProperty) GetType ¶
func (p EmailProperty) GetType() PropertyType
type EmailPropertyConfig ¶
type EmailPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Email struct{} `json:"email"` }
func (EmailPropertyConfig) GetID ¶
func (p EmailPropertyConfig) GetID() PropertyID
func (EmailPropertyConfig) GetType ¶
func (p EmailPropertyConfig) GetType() PropertyConfigType
type EmbedBlock ¶
type EmbedBlock struct { BasicBlock Embed Embed `json:"embed"` }
type EquationBlock ¶
type EquationBlock struct { BasicBlock Equation Equation `json:"equation"` }
type Error ¶
type Error struct { Object ObjectType `json:"object"` Status int `json:"status"` Code ErrorCode `json:"code"` Message string `json:"message"` }
type ExternalAccount ¶
type File ¶
type File struct { Name string `json:"name"` Type FileType `json:"type"` File *FileObject `json:"file,omitempty"` External *FileObject `json:"external,omitempty"` }
type FileBlock ¶
type FileBlock struct { BasicBlock File BlockFile `json:"file"` }
type FileObject ¶
type FilesFilterCondition ¶
type FilesProperty ¶
type FilesProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Files []File `json:"files"` }
func (FilesProperty) GetID ¶
func (p FilesProperty) GetID() PropertyID
func (FilesProperty) GetType ¶
func (p FilesProperty) GetType() PropertyType
type FilesPropertyConfig ¶
type FilesPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Files struct{} `json:"files"` }
func (FilesPropertyConfig) GetID ¶
func (p FilesPropertyConfig) GetID() PropertyID
func (FilesPropertyConfig) GetType ¶
func (p FilesPropertyConfig) GetType() PropertyConfigType
type FilterOperator ¶
type FilterOperator string
const ( FilterOperatorAND FilterOperator = "and" FilterOperatorOR FilterOperator = "or" )
type FormatType ¶
type FormatType string
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" )
func (FormatType) String ¶
func (ft FormatType) String() string
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"` }
type FormulaConfig ¶
type FormulaConfig struct {
Expression string `json:"expression"`
}
type FormulaFilterCondition ¶
type FormulaFilterCondition struct { Text *TextFilterCondition `json:"text,omitempty"` Checkbox *CheckboxFilterCondition `json:"checkbox,omitempty"` Number *NumberFilterCondition `json:"number,omitempty"` Date *DateFilterCondition `json:"date,omitempty"` }
type FormulaProperty ¶
type FormulaProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Formula Formula `json:"formula"` }
func (FormulaProperty) GetID ¶
func (p FormulaProperty) GetID() PropertyID
func (FormulaProperty) GetType ¶
func (p FormulaProperty) GetType() PropertyType
type FormulaPropertyConfig ¶
type FormulaPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Formula FormulaConfig `json:"formula"` }
func (FormulaPropertyConfig) GetID ¶
func (p FormulaPropertyConfig) GetID() PropertyID
func (FormulaPropertyConfig) GetType ¶
func (p FormulaPropertyConfig) GetType() PropertyConfigType
type FormulaType ¶
type FormulaType string
const ( FormulaTypeString FormulaType = "string" FormulaTypeNumber FormulaType = "number" FormulaTypeBoolean FormulaType = "boolean" FormulaTypeDate FormulaType = "date" )
type FunctionType ¶
type FunctionType string
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" )
func (FunctionType) String ¶
func (ft FunctionType) String() string
type GetChildrenResponse ¶
type GetChildrenResponse struct { Object ObjectType `json:"object"` Results Blocks `json:"results"` NextCursor string `json:"next_cursor"` HasMore bool `json:"has_more"` }
type Heading1Block ¶
type Heading1Block struct { BasicBlock Heading1 Heading `json:"heading_1"` }
type Heading2Block ¶
type Heading2Block struct { BasicBlock Heading2 Heading `json:"heading_2"` }
type Heading3Block ¶
type Heading3Block struct { BasicBlock Heading3 Heading `json:"heading_3"` }
type Icon ¶
type Icon struct { Type FileType `json:"type"` Emoji *Emoji `json:"emoji,omitempty"` File *FileObject `json:"file,omitempty"` External *FileObject `json:"external,omitempty"` }
type Image ¶
type Image struct { Caption []RichText `json:"caption,omitempty"` Type FileType `json:"type"` File *FileObject `json:"file,omitempty"` External *FileObject `json:"external,omitempty"` }
type ImageBlock ¶
type ImageBlock struct { BasicBlock Image Image `json:"image"` }
type LastEditedByProperty ¶
type LastEditedByProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` LastEditedBy User `json:"last_edited_by"` }
func (LastEditedByProperty) GetID ¶
func (p LastEditedByProperty) GetID() PropertyID
func (LastEditedByProperty) GetType ¶
func (p LastEditedByProperty) GetType() PropertyType
type LastEditedByPropertyConfig ¶
type LastEditedByPropertyConfig struct { ID PropertyID `json:"id"` Type PropertyConfigType `json:"type"` LastEditedBy struct{} `json:"last_edited_by"` }
func (LastEditedByPropertyConfig) GetID ¶
func (p LastEditedByPropertyConfig) GetID() PropertyID
func (LastEditedByPropertyConfig) GetType ¶
func (p LastEditedByPropertyConfig) GetType() PropertyConfigType
type LastEditedTimeProperty ¶
type LastEditedTimeProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` LastEditedTime time.Time `json:"last_edited_time"` }
func (LastEditedTimeProperty) GetID ¶
func (p LastEditedTimeProperty) GetID() PropertyID
func (LastEditedTimeProperty) GetType ¶
func (p LastEditedTimeProperty) GetType() PropertyType
type LastEditedTimePropertyConfig ¶
type LastEditedTimePropertyConfig struct { ID PropertyID `json:"id"` Type PropertyConfigType `json:"type"` LastEditedTime struct{} `json:"last_edited_time"` }
func (LastEditedTimePropertyConfig) GetID ¶
func (p LastEditedTimePropertyConfig) GetID() PropertyID
func (LastEditedTimePropertyConfig) GetType ¶
func (p LastEditedTimePropertyConfig) GetType() PropertyConfigType
type LinkPreview ¶
type LinkPreview struct {
URL string `json:"url"`
}
type LinkPreviewBlock ¶
type LinkPreviewBlock struct { BasicBlock LinkPreview LinkPreview `json:"link_preview"` }
NOTE: will only be returned by the API. Cannot be created by the API. https://developers.notion.com/reference/block#link-preview-blocks
type LinkToPage ¶
type LinkToPage struct { Type BlockType `json:"type"` PageID PageID `json:"page_id,omitempty"` DatabaseID DatabaseID `json:"database_id,omitempty"` }
type LinkToPageBlock ¶
type LinkToPageBlock struct { BasicBlock LinkToPage LinkToPage `json:"link_to_page"` }
type Mention ¶
type Mention struct { Type MentionType `json:"type,omitempty"` Database *DatabaseMention `json:"database,omitempty"` Page *PageMention `json:"page,omitempty"` User *User `json:"user,omitempty"` Date *DateObject `json:"date,omitempty"` TemplateMention *TemplateMention `json:"template_mention,omitempty"` }
type MentionType ¶
type MentionType string
const ( MentionTypeDatabase MentionType = "database" MentionTypePage MentionType = "page" MentionTypeUser MentionType = "user" MentionTypeDate MentionType = "date" MentionTypeTemplateMention MentionType = "template_mention" )
func (MentionType) String ¶
func (mType MentionType) String() string
type MultiSelectProperty ¶
type MultiSelectProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` MultiSelect []Option `json:"multi_select"` }
func (MultiSelectProperty) GetID ¶
func (p MultiSelectProperty) GetID() PropertyID
func (MultiSelectProperty) GetType ¶
func (p MultiSelectProperty) GetType() PropertyType
type MultiSelectPropertyConfig ¶
type MultiSelectPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` MultiSelect Select `json:"multi_select"` }
func (MultiSelectPropertyConfig) GetID ¶
func (p MultiSelectPropertyConfig) GetID() PropertyID
func (MultiSelectPropertyConfig) GetType ¶
func (p MultiSelectPropertyConfig) GetType() PropertyConfigType
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"` }
type NumberFormat ¶
type NumberFormat struct {
Format FormatType `json:"format"`
}
type NumberProperty ¶
type NumberProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Number *float64 `json:"number"` }
func (NumberProperty) GetID ¶
func (p NumberProperty) GetID() PropertyID
func (NumberProperty) GetType ¶
func (p NumberProperty) GetType() PropertyType
type NumberPropertyConfig ¶
type NumberPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Number NumberFormat `json:"number"` }
func (NumberPropertyConfig) GetID ¶
func (p NumberPropertyConfig) GetID() PropertyID
func (NumberPropertyConfig) GetType ¶
func (p NumberPropertyConfig) GetType() PropertyConfigType
type NumberedListItemBlock ¶
type NumberedListItemBlock struct { BasicBlock NumberedListItem ListItem `json:"numbered_list_item"` }
type Object ¶
type Object interface {
GetObject() ObjectType
}
type ObjectType ¶
type ObjectType string
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" )
func (ObjectType) String ¶
func (ot ObjectType) String() string
type Option ¶
type Option struct { ID PropertyID `json:"id,omitempty"` Name string `json:"name"` Color Color `json:"color,omitempty"` }
type OrCompoundFilter ¶
type OrCompoundFilter []Filter
func (OrCompoundFilter) MarshalJSON ¶
func (f OrCompoundFilter) MarshalJSON() ([]byte, error)
type Page ¶
type Page struct { Object ObjectType `json:"object"` ID ObjectID `json:"id"` CreatedTime time.Time `json:"created_time"` LastEditedTime time.Time `json:"last_edited_time"` CreatedBy User `json:"created_by,omitempty"` LastEditedBy User `json:"last_edited_by,omitempty"` Archived bool `json:"archived"` Properties Properties `json:"properties"` Parent Parent `json:"parent"` URL string `json:"url"` Icon *Icon `json:"icon,omitempty"` Cover *Image `json:"cover,omitempty"` }
func (*Page) GetObject ¶
func (p *Page) GetObject() ObjectType
type PageClient ¶
type PageClient struct {
// contains filtered or unexported fields
}
func (*PageClient) Create ¶
func (pc *PageClient) Create(ctx context.Context, requestBody *PageCreateRequest) (*Page, error)
func (*PageClient) Update ¶
func (pc *PageClient) Update(ctx context.Context, id PageID, request *PageUpdateRequest) (*Page, error)
type PageCreateRequest ¶
type PageCreateRequest struct { Parent Parent `json:"parent"` Properties Properties `json:"properties"` Children []Block `json:"children,omitempty"` Icon *Icon `json:"icon,omitempty"` Cover *Image `json:"cover,omitempty"` }
type PageMention ¶
type PageMention struct {
ID ObjectID `json:"id"`
}
type PageService ¶
type PageUpdateRequest ¶
type PageUpdateRequest struct { Properties Properties `json:"properties"` Archived bool `json:"archived"` Icon *Icon `json:"icon,omitempty"` Cover *Image `json:"cover,omitempty"` }
type Pagination ¶
func (*Pagination) ToQuery ¶
func (p *Pagination) ToQuery() map[string]string
type ParagraphBlock ¶
type ParagraphBlock struct { BasicBlock Paragraph Paragraph `json:"paragraph"` }
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"` }
type ParentType ¶
type ParentType string
const ( ParentTypeDatabaseID ParentType = "database_id" ParentTypePageID ParentType = "page_id" ParentTypeWorkspace ParentType = "workspace" ParentTypeBlockID ParentType = "block_id" )
type Pdf ¶
type Pdf struct { Caption []RichText `json:"caption,omitempty"` Type FileType `json:"type"` File *FileObject `json:"file,omitempty"` External *FileObject `json:"external,omitempty"` }
type PdfBlock ¶
type PdfBlock struct { BasicBlock Pdf Pdf `json:"pdf"` }
type PeopleFilterCondition ¶
type PeopleProperty ¶
type PeopleProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` People []User `json:"people"` }
func (PeopleProperty) GetID ¶
func (p PeopleProperty) GetID() PropertyID
func (PeopleProperty) GetType ¶
func (p PeopleProperty) GetType() PropertyType
type PeoplePropertyConfig ¶
type PeoplePropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` People struct{} `json:"people"` }
func (PeoplePropertyConfig) GetID ¶
func (p PeoplePropertyConfig) GetID() PropertyID
func (PeoplePropertyConfig) GetType ¶
func (p PeoplePropertyConfig) GetType() PropertyConfigType
type PhoneNumberProperty ¶
type PhoneNumberProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` PhoneNumber string `json:"phone_number"` }
func (PhoneNumberProperty) GetID ¶
func (p PhoneNumberProperty) GetID() PropertyID
func (PhoneNumberProperty) GetType ¶
func (p PhoneNumberProperty) GetType() PropertyType
type PhoneNumberPropertyConfig ¶
type PhoneNumberPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` PhoneNumber struct{} `json:"phone_number"` }
func (PhoneNumberPropertyConfig) GetID ¶
func (p PhoneNumberPropertyConfig) GetID() PropertyID
func (PhoneNumberPropertyConfig) GetType ¶
func (p PhoneNumberPropertyConfig) GetType() PropertyConfigType
type Properties ¶
func (*Properties) UnmarshalJSON ¶
func (p *Properties) UnmarshalJSON(data []byte) error
type Property ¶
type Property interface { GetType() PropertyType GetID() PropertyID }
type PropertyArray ¶
type PropertyArray []Property
func (*PropertyArray) UnmarshalJSON ¶
func (arr *PropertyArray) UnmarshalJSON(data []byte) error
type PropertyConfig ¶
type PropertyConfig interface { GetType() PropertyConfigType GetID() PropertyID }
type PropertyConfigType ¶
type PropertyConfigType string
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" )
type PropertyConfigs ¶
type PropertyConfigs map[string]PropertyConfig
func (*PropertyConfigs) UnmarshalJSON ¶
func (p *PropertyConfigs) UnmarshalJSON(data []byte) error
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"` }
type PropertyID ¶
type PropertyID string
func (PropertyID) String ¶
func (pID PropertyID) String() string
type PropertyType ¶
type PropertyType string
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" )
type QuoteBlock ¶
type QuoteBlock struct { BasicBlock Quote Quote `json:"quote"` }
type RateLimitedError ¶
type RateLimitedError struct {
Message string
}
func (*RateLimitedError) Error ¶
func (e *RateLimitedError) Error() string
type RelationConfig ¶
type RelationConfig struct { DatabaseID DatabaseID `json:"database_id"` SyncedPropertyID PropertyID `json:"synced_property_id"` SyncedPropertyName string `json:"synced_property_name"` }
type RelationFilterCondition ¶
type RelationObject ¶
type RelationObject struct { Database DatabaseID `json:"database"` SyncedPropertyName string `json:"synced_property_name"` }
type RelationProperty ¶
type RelationProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Relation []Relation `json:"relation"` }
func (RelationProperty) GetID ¶
func (p RelationProperty) GetID() PropertyID
func (RelationProperty) GetType ¶
func (p RelationProperty) GetType() PropertyType
type RelationPropertyConfig ¶
type RelationPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Relation RelationConfig `json:"relation"` }
func (RelationPropertyConfig) GetID ¶
func (p RelationPropertyConfig) GetID() PropertyID
func (RelationPropertyConfig) GetType ¶
func (p RelationPropertyConfig) GetType() PropertyConfigType
type RichText ¶
type RichText struct { Type ObjectType `json:"type,omitempty"` Text *Text `json:"text,omitempty"` Mention *Mention `json:"mention,omitempty"` Equation *Equation `json:"equation,omitempty"` Annotations *Annotations `json:"annotations,omitempty"` PlainText string `json:"plain_text,omitempty"` Href string `json:"href,omitempty"` }
type RichTextProperty ¶
type RichTextProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` RichText []RichText `json:"rich_text"` }
func (RichTextProperty) GetID ¶
func (p RichTextProperty) GetID() PropertyID
func (RichTextProperty) GetType ¶
func (p RichTextProperty) GetType() PropertyType
type RichTextPropertyConfig ¶
type RichTextPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` RichText struct{} `json:"rich_text"` }
func (RichTextPropertyConfig) GetID ¶
func (p RichTextPropertyConfig) GetID() PropertyID
func (RichTextPropertyConfig) GetType ¶
func (p RichTextPropertyConfig) GetType() PropertyConfigType
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"` }
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"` }
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"` }
type RollupProperty ¶
type RollupProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Rollup Rollup `json:"rollup"` }
func (RollupProperty) GetID ¶
func (p RollupProperty) GetID() PropertyID
func (RollupProperty) GetType ¶
func (p RollupProperty) GetType() PropertyType
type RollupPropertyConfig ¶
type RollupPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Rollup RollupConfig `json:"rollup"` }
func (RollupPropertyConfig) GetID ¶
func (p RollupPropertyConfig) GetID() PropertyID
func (RollupPropertyConfig) GetType ¶
func (p RollupPropertyConfig) GetType() PropertyConfigType
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"` }
type RollupType ¶
type RollupType string
const ( RollupTypeNumber RollupType = "number" RollupTypeDate RollupType = "date" RollupTypeArray RollupType = "array" )
type SearchClient ¶
type SearchClient struct {
// contains filtered or unexported fields
}
func (*SearchClient) Do ¶
func (sc *SearchClient) Do(ctx context.Context, request *SearchRequest) (*SearchResponse, error)
Do search https://developers.notion.com/reference/post-search
type SearchFilter ¶
type SearchRequest ¶
type SearchRequest struct { Query string `json:"query,omitempty"` Sort *SortObject `json:"sort,omitempty"` Filter SearchFilter `json:"filter,omitempty"` StartCursor Cursor `json:"start_cursor,omitempty"` PageSize int `json:"page_size,omitempty"` }
type SearchResponse ¶
type SearchResponse struct { Object ObjectType `json:"object"` Results []Object `json:"results"` HasMore bool `json:"has_more"` NextCursor Cursor `json:"next_cursor"` }
func (*SearchResponse) UnmarshalJSON ¶
func (sr *SearchResponse) UnmarshalJSON(data []byte) error
type SearchService ¶
type SearchService interface {
Do(context.Context, *SearchRequest) (*SearchResponse, error)
}
type SelectFilterCondition ¶
type SelectProperty ¶
type SelectProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Select Option `json:"select"` }
func (SelectProperty) GetID ¶
func (p SelectProperty) GetID() PropertyID
func (SelectProperty) GetType ¶
func (p SelectProperty) GetType() PropertyType
type SelectPropertyConfig ¶
type SelectPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Select Select `json:"select"` }
func (SelectPropertyConfig) GetID ¶
func (p SelectPropertyConfig) GetID() PropertyID
func (SelectPropertyConfig) GetType ¶
func (p SelectPropertyConfig) GetType() PropertyConfigType
type SortObject ¶
type SortObject struct { Property string `json:"property,omitempty"` Timestamp TimestampType `json:"timestamp,omitempty"` Direction SortOrder `json:"direction,omitempty"` }
type StatusFilterCondition ¶
type StatusProperty ¶
type StatusProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Status Status `json:"status"` }
func (StatusProperty) GetID ¶
func (p StatusProperty) GetID() PropertyID
func (StatusProperty) GetType ¶
func (p StatusProperty) GetType() PropertyType
type StatusPropertyConfig ¶
type StatusPropertyConfig struct { ID PropertyID `json:"id"` Type PropertyConfigType `json:"type"` Status Select `json:"status"` }
StatusPropertyConfig can only be used to GET property configs from Notion databases. The api currently does not support creating or updating status properties.
func (StatusPropertyConfig) GetID ¶
func (p StatusPropertyConfig) GetID() PropertyID
func (StatusPropertyConfig) GetType ¶
func (p StatusPropertyConfig) GetType() PropertyConfigType
type Synced ¶
type Synced struct { // SyncedFrom is nil for the original block. SyncedFrom *SyncedFrom `json:"synced_from"` Children Blocks `json:"children,omitempty"` }
type SyncedBlock ¶
type SyncedBlock struct { BasicBlock SyncedBlock Synced `json:"synced_block"` }
type SyncedFrom ¶
type SyncedFrom struct {
BlockID BlockID `json:"block_id"`
}
type TableBlock ¶
type TableBlock struct { BasicBlock Table Table `json:"table"` }
type TableOfContents ¶
type TableOfContents struct { // empty Color string `json:"color,omitempty"` }
type TableOfContentsBlock ¶
type TableOfContentsBlock struct { BasicBlock TableOfContents TableOfContents `json:"table_of_contents"` }
type TableRowBlock ¶
type TableRowBlock struct { BasicBlock TableRow TableRow `json:"table_row"` }
type TemplateBlock ¶
type TemplateBlock struct { BasicBlock Template Template `json:"template"` }
type TemplateMention ¶
type TemplateMention struct { Type TemplateMentionType `json:"type"` TemplateMentionUser string `json:"template_mention_user,omitempty"` TemplateMentionDate string `json:"template_mention_date,omitempty"` }
type TemplateMentionType ¶
type TemplateMentionType string
const ( TemplateMentionTypeUser TemplateMentionType = "template_mention_user" TemplateMentionTypeDate TemplateMentionType = "template_mention_date" )
func (TemplateMentionType) String ¶
func (tMType TemplateMentionType) String() string
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"` }
type TextProperty ¶
type TextProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Text []RichText `json:"text"` }
func (TextProperty) GetID ¶
func (p TextProperty) GetID() PropertyID
func (TextProperty) GetType ¶
func (p TextProperty) GetType() PropertyType
type TimestampFilter ¶
type TimestampFilter struct { Timestamp TimestampType `json:"timestamp"` CreatedTime *DateFilterCondition `json:"created_time,omitempty"` LastEditedTime *DateFilterCondition `json:"last_edited_time,omitempty"` }
type TimestampType ¶
type TimestampType string
const ( TimestampCreated TimestampType = "created_time" TimestampLastEdited TimestampType = "last_edited_time" )
type TitleProperty ¶
type TitleProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` Title []RichText `json:"title"` }
func (TitleProperty) GetID ¶
func (p TitleProperty) GetID() PropertyID
func (TitleProperty) GetType ¶
func (p TitleProperty) GetType() PropertyType
type TitlePropertyConfig ¶
type TitlePropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` Title struct{} `json:"title"` }
func (TitlePropertyConfig) GetID ¶
func (p TitlePropertyConfig) GetID() PropertyID
func (TitlePropertyConfig) GetType ¶
func (p TitlePropertyConfig) GetType() PropertyConfigType
type ToDoBlock ¶
type ToDoBlock struct { BasicBlock ToDo ToDo `json:"to_do"` }
type ToggleBlock ¶
type ToggleBlock struct { BasicBlock Toggle Toggle `json:"toggle"` }
type TokenCreateRequest ¶
type TokenCreateRequest struct { Code string `json:"code"` GrantType string `json:"grant_type"` // Default value of grant_type is always "authorization_code" RedirectUri string `json:"redirect_uri"` ExternalAccount ExternalAccount `json:"external_account,omitempty"` }
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 interface{} `json:"owner,omitempty"` WorkspaceIcon string `json:"workspace_icon"` WorkspaceId string `json:"workspace_id"` WorkspaceName string `json:"workspace_name"` }
type URLProperty ¶
type URLProperty struct { ID PropertyID `json:"id,omitempty"` Type PropertyType `json:"type,omitempty"` URL string `json:"url"` }
func (URLProperty) GetID ¶
func (p URLProperty) GetID() PropertyID
func (URLProperty) GetType ¶
func (p URLProperty) GetType() PropertyType
type URLPropertyConfig ¶
type URLPropertyConfig struct { ID PropertyID `json:"id,omitempty"` Type PropertyConfigType `json:"type"` URL struct{} `json:"url"` }
func (URLPropertyConfig) GetID ¶
func (p URLPropertyConfig) GetID() PropertyID
func (URLPropertyConfig) GetType ¶
func (p URLPropertyConfig) GetType() PropertyConfigType
type UnsupportedBlock ¶
type UnsupportedBlock struct {
BasicBlock
}
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
func (*UserClient) List ¶
func (uc *UserClient) List(ctx context.Context, pagination *Pagination) (*UsersListResponse, error)
type UserService ¶
type UsersListResponse ¶
type UsersListResponse struct { Object ObjectType `json:"object"` Results []User `json:"results"` HasMore bool `json:"has_more"` NextCursor Cursor `json:"next_cursor"` }
type Video ¶
type Video struct { Caption []RichText `json:"caption,omitempty"` Type FileType `json:"type"` File *FileObject `json:"file,omitempty"` External *FileObject `json:"external,omitempty"` }
type VideoBlock ¶
type VideoBlock struct { BasicBlock Video Video `json:"video"` }