Documentation
¶
Index ¶
- Constants
- Variables
- func ParseTime(t string) (time.Time, error)
- func TimeFormat(t time.Time) string
- type API
- type Annotations
- type BaseConfiguration
- type BaseProperty
- type Block
- func AssignBlock(json JSON) (Block, error)
- func NewBlock(j JSON) Block
- func NewBlockBulletedListItem(Text []RichText, Children ...Block) Block
- func NewBlockChildPage(PageID string) Block
- func NewBlockHeading1(Text []RichText) Block
- func NewBlockHeading2(Text []RichText) Block
- func NewBlockHeading3(Text []RichText) Block
- func NewBlockNumberedListItem(Text []RichText, Children ...Block) Block
- func NewBlockParagraph(Text []RichText) Block
- func NewBlockTodo(Checked bool, Text []RichText, Children ...Block) Block
- func NewBlockToggle(Text []RichText, Children ...Block) Block
- type BlockBulletedListItem
- type BlockChildPage
- type BlockHeading1
- type BlockHeading2
- type BlockHeading3
- type BlockNumberedListItem
- type BlockParagraph
- type BlockTodo
- type BlockToggle
- type BlockUnsupported
- type ChildrenBlock
- type Color
- type CompoundFilter
- type Condition
- type ConditionCheckbox
- type ConditionDate
- type ConditionFiles
- type ConditionFormula
- type ConditionFuncBoolean
- type ConditionFuncNumber
- type ConditionFuncObject
- type ConditionFuncString
- type ConditionMultiSelect
- type ConditionNumber
- type ConditionPeople
- type ConditionSelect
- type ConditionText
- type Conditioner
- type Configuration
- type ConfigurationCheckbox
- type ConfigurationDate
- type ConfigurationEmail
- type ConfigurationFile
- type ConfigurationFormula
- type ConfigurationMultiSelect
- type ConfigurationNumber
- type ConfigurationPeople
- type ConfigurationPhoneNumber
- type ConfigurationSelect
- type ConfigurationText
- type ConfigurationTitle
- type ConfigurationURL
- type CustomBlock
- func (block *CustomBlock) CreatedTime() string
- func (block *CustomBlock) HasChildren() bool
- func (block *CustomBlock) ID() string
- func (block *CustomBlock) Interface() interface{}
- func (block *CustomBlock) Json() JSON
- func (block *CustomBlock) LastEditedTime() string
- func (block *CustomBlock) Object() string
- func (block *CustomBlock) Type() string
- type Database
- type DatabasePropertyFilter
- type Date
- type Direction
- type Equation
- type File
- type Filter
- type FilterOperation
- type JSON
- func (j JSON) Append(name string, v interface{})
- func (j JSON) Get(name string) interface{}
- func (j JSON) GetBool(name string) bool
- func (j JSON) GetFloat(name string) float64
- func (j JSON) GetInt(name string) int
- func (j JSON) GetJSON(name string) (JSON, bool)
- func (j JSON) GetJSONList(name string) ([]JSON, bool)
- func (j JSON) GetString(name string) string
- func (j JSON) Marshal(v interface{}) error
- func (j JSON) Set(name string, v interface{})
- func (j JSON) String() string
- func (j JSON) Unmarshal(v interface{}) error
- type Link
- type Notion
- func (notion *Notion) APIVersion() string
- func (notion *Notion) AppendBlockChildren(BlockID string, Children []Block) (Block, error)
- func (notion *Notion) CreatePage(Parent *Parent, Properties []Property, Children ...Block) (*Page, error)
- func (notion *Notion) ListAllUsers(pagination *PaginationRequest) (*PaginationResponse, error)
- func (notion *Notion) ListDatabases(Pagination *PaginationRequest) (*PaginationResponse, error)
- func (notion *Notion) QueryDatabase(DatabaseID string, Pagination *PaginationRequest, Filter Filter, Sorts []Sort) (*PaginationResponse, error)
- func (notion *Notion) RetrieveBlockChildren(BlockID string, pagination *PaginationRequest) (*PaginationResponse, error)
- func (notion *Notion) RetrieveDatabase(DatabaseID string) (*Database, error)
- func (notion *Notion) RetrievePage(PageID string) (*Page, error)
- func (notion *Notion) RetrieveUser(UserID string) (*User, error)
- func (notion *Notion) Search(Query string, Pagination *PaginationRequest, Filter Object, Sort *Sort) (*PaginationResponse, error)
- func (notion *Notion) UpdatePageProperties(PageID string, Properties ...Property) (*Page, error)
- type Object
- type Page
- type PaginationRequest
- type PaginationResponse
- func (response *PaginationResponse) Blocks() ([]Block, error)
- func (response *PaginationResponse) Databases() ([]Database, error)
- func (response *PaginationResponse) Pages() ([]Page, error)
- func (response *PaginationResponse) Unmarshal(v interface{}) error
- func (response *PaginationResponse) Users() ([]User, error)
- type Parent
- type Property
- func AssignProperty(name string, json JSON) (Property, error)
- func NewProperty(j JSON) Property
- func NewPropertyCheckbox(Name string, checked bool) Property
- func NewPropertyDate(Name string, Date *Date) Property
- func NewPropertyEmail(Name string, Email string) Property
- func NewPropertyFiles(Name string, Files ...File) Property
- func NewPropertyFormula(Name string, v interface{}) Property
- func NewPropertyMultiSelect(Name string, Select ...SelectOption) Property
- func NewPropertyNumber(Name string, Number int) Property
- func NewPropertyPeople(Name string, User ...User) Property
- func NewPropertyPhoneNumber(Name string, PhoneNumber string) Property
- func NewPropertyRichText(Name string, text []RichText) Property
- func NewPropertySelect(Name string, Select *SelectOption) Property
- func NewPropertyTitle(Name string, text []RichText) Property
- func NewPropertyURL(Name string, URL string) Property
- type PropertyCheckbox
- type PropertyDate
- type PropertyEmail
- type PropertyFiles
- type PropertyFormula
- type PropertyMultiSelect
- type PropertyNumber
- type PropertyPeople
- type PropertyPhoneNumber
- type PropertyRichText
- type PropertySelect
- type PropertyTitle
- type PropertyURL
- type RichText
- func (rt *RichText) GetAnnotations() (*Annotations, error)
- func (rt *RichText) GetEquation() (*Equation, error)
- func (rt *RichText) GetMentionDatabase() (*Database, error)
- func (rt *RichText) GetMentionDate() (*Date, error)
- func (rt *RichText) GetMentionPage() (*Page, error)
- func (rt *RichText) GetMentionUser() (*User, error)
- func (rt *RichText) GetText() (*Text, error)
- func (rt *RichText) Href() string
- func (rt *RichText) PlainText() string
- func (rt *RichText) SetAnnotations(annotations *Annotations)
- func (rt *RichText) SetEquation(equation *Equation)
- func (rt *RichText) SetMentionDatabase(database *Database) error
- func (rt *RichText) SetMentionDate(date *Date) error
- func (rt *RichText) SetMentionPage(page *Page) error
- func (rt *RichText) SetMentionUser(user *User) error
- func (rt *RichText) SetText(text *Text)
- func (rt *RichText) Type() string
- type RichTextBlock
- type RichTextProperty
- type SelectOption
- type SelectOptionsConfiguration
- type Sort
- type Text
- type Timestamp
- type User
Constants ¶
View Source
const ( TypeBlockParagraph = "paragraph" TypeBlockHeading1 = "heading_1" TypeBlockHeading2 = "heading_2" TypeBlockHeading3 = "heading_3" TypeBlockBulletedListItem = "bulleted_list_item" TypeBlockNumberedListItem = "numbered_list_item" TypeBlockTodo = "to_do" TypeBlockToggle = "toggle" TypeBlockChildPage = "child_page" TypeBlockUnsupported = "unsupported" )
View Source
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") 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") )
View Source
const ( ObjectUser = Object("user") ObjectDatabase = Object("database") ObjectPage = Object("page") ObjectBlock = Object("block") )
View Source
const ( TypeParentDatabase = "database_id" TypeParentPage = "page_id" TypeParentWorkspace = "workspace" )
View Source
const ( TypePropertyTitle = "title" TypePropertyRichText = "rich_text" TypePropertyNumber = "number" TypePropertySelect = "select" TypePropertyMultiSelect = "multi_select" TypePropertyDate = "date" TypePropertyFormula = "formula" TypePropertyPeople = "people" TypePropertyFiles = "files" TypePropertyCheckbox = "checkbox" TypePropertyURL = "url" TypePropertyEmail = "email" TypePropertyPhoneNumber = "phone_number" )
View Source
const ( FilterOperationOR = FilterOperation("or") FilterOperationAND = FilterOperation("and") )
View Source
const ( CreatedTime = Timestamp("created_time") LastEditedTime = Timestamp("last_edited_time") )
View Source
const ( Ascending = Direction("ascending") Descending = Direction("descending") )
View Source
const ( UserTypePerson = "pserson" UserTypeBot = "bot" )
Variables ¶
View Source
var FilterCheckbox = &ConditionCheckbox{ Equals: func(value bool) Condition { return NewCondition("checkbox", "equals", value) }, DoesNotEqual: func(value bool) Condition { return NewCondition("checkbox", "does_not_equal", value) }, }
View Source
var FilterDate = &ConditionDate{ Equals: func(value string) Condition { return NewCondition("date", "equals", value) }, Before: func(value string) Condition { return NewCondition("date", "before", value) }, After: func(value string) Condition { return NewCondition("date", "after", value) }, OnOrBefore: func(value string) Condition { return NewCondition("date", "on_or_before", value) }, IsEmpty: func(value bool) Condition { return NewCondition("date", "is_empty", true) }, IsNotEmpty: func(value bool) Condition { return NewCondition("date", "is_not_empty", true) }, OnOrAfter: func(value string) Condition { return NewCondition("date", "on_or_after", value) }, PastWeek: func(value interface{}) Condition { return NewCondition("date", "past_week", JSON{}) }, PastMonth: func(value interface{}) Condition { return NewCondition("date", "past_month", JSON{}) }, PastYear: func(value interface{}) Condition { return NewCondition("date", "past_year", JSON{}) }, NextWeek: func(value interface{}) Condition { return NewCondition("date", "next_week", JSON{}) }, NextMonth: func(value interface{}) Condition { return NewCondition("date", "next_month", JSON{}) }, NextYear: func(value interface{}) Condition { return NewCondition("date", "next_year", JSON{}) }, }
View Source
var FilterFiles = &ConditionFiles{ IsEmpty: func(value bool) Condition { return NewCondition("files", "is_empty", true) }, IsNotEmpty: func(value bool) Condition { return NewCondition("files", "is_not_empty", true) }, }
View Source
var FilterFormula = &ConditionFormula{ Text: FilterText, Checkbox: FilterCheckbox, Number: FilterNumber, Date: FilterDate, }
View Source
var FilterMultiSelect = &ConditionMultiSelect{ Contains: func(value string) Condition { return NewCondition("multi_select", "contains", value) }, DoesNotContain: func(value string) Condition { return NewCondition("multi_select", "doeS_not_contain", value) }, IsEmpty: func(value bool) Condition { return NewCondition("multi_select", "is_empty", true) }, IsNotEmpty: func(value bool) Condition { return NewCondition("multi_select", "is_not_empty", true) }, }
View Source
var FilterNumber = &ConditionNumber{ Equals: func(value int) Condition { return NewCondition("number", "equals", value) }, DoesNotEqual: func(value int) Condition { return NewCondition("number", "does_not_equal", value) }, GreaterThan: func(value int) Condition { return NewCondition("number", "greater_than", value) }, LessThan: func(value int) Condition { return NewCondition("number", "less_than", value) }, GreaterThanOrEqualTo: func(value int) Condition { return NewCondition("number", "greater_than_or_equal_to", value) }, LessThanOrEqualTo: func(value int) Condition { return NewCondition("number", "less_than_or_equal_to", value) }, IsEmpty: func(value bool) Condition { return NewCondition("number", "is_empty", true) }, IsNotEmpty: func(value bool) Condition { return NewCondition("number", "is_not_empty", true) }, }
View Source
var FilterPeople = &ConditionPeople{ Contains: func(value string) Condition { return NewCondition("people", "contains", value) }, DoesNotContain: func(value string) Condition { return NewCondition("people", "does_not_contain", value) }, IsEmpty: func(value bool) Condition { return NewCondition("people", "is_empty", true) }, IsNotEmpty: func(value bool) Condition { return NewCondition("people", "is_not_empty", true) }, }
View Source
var FilterSelect = &ConditionSelect{ Equals: func(value string) Condition { return NewCondition("select", "equals", value) }, DoesNotEqual: func(value string) Condition { return NewCondition("select", "does_not_equal", value) }, IsEmpty: func(value bool) Condition { return NewCondition("select", "is_empty", true) }, IsNotEmpty: func(value bool) Condition { return NewCondition("select", "is_not_empty", true) }, }
View Source
var FilterText = &ConditionText{ Equals: func(value string) Condition { return NewCondition("text", "equals", value) }, DoesNotEqual: func(value string) Condition { return NewCondition("text", "does_not_equal", value) }, Contains: func(value string) Condition { return NewCondition("text", "contains", value) }, DoesNotContain: func(value string) Condition { return NewCondition("text", "does_not_contain", value) }, StartsWith: func(value string) Condition { return NewCondition("text", "starts_with", value) }, EndsWith: func(value string) Condition { return NewCondition("text", "ends_with", value) }, IsEmpty: func(value bool) Condition { return NewCondition("text", "is_empty", true) }, IsNotEmpty: func(value bool) Condition { return NewCondition("text", "is_not_empty", true) }, }
Functions ¶
func TimeFormat ¶
Types ¶
type API ¶
type API interface {
ListAllUsers(pagination *PaginationRequest) (*PaginationResponse, error)
RetrieveUser(UserID string) (*User, error)
RetrieveBlockChildren(BlockID string, pagination *PaginationRequest) (*PaginationResponse, error)
AppendBlockChildren(BlockID string, Children []Block) (Block, error)
RetrievePage(PageID string) (*Page, error)
CreatePage(Parent *Parent, Properties []Property, Children ...Block) (*Page, error)
UpdatePageProperties(PageID string, Properties ...Property) (*Page, error)
RetrieveDatabase(DatabaseID string) (*Database, error)
QueryDatabase(DatabaseID string, Pagination *PaginationRequest, Filter Filter, Sorts []Sort) (*PaginationResponse, error)
ListDatabases(Pagination *PaginationRequest) (*PaginationResponse, error)
Search(Query string, Pagination *PaginationRequest, Filter Object, Sort *Sort) (*PaginationResponse, error)
Version() string
}
type Annotations ¶
type Annotations struct {
Bold bool `json:"bold"`
Italic bool `json:"italic"`
Strikethrough bool `json:"strikethrough"`
Underline bool `json:"underline"`
Code bool `json:"code"`
Color string `json:"color"`
}
func NewAnnotations ¶
func NewAnnotations() *Annotations
NewAnnotations Create Annotations Struct, set color with "default"
type BaseConfiguration ¶
type BaseConfiguration struct {
*BaseProperty
}
type BaseProperty ¶
type BaseProperty struct {
JSON JSON
// contains filtered or unexported fields
}
func (*BaseProperty) ID ¶
func (property *BaseProperty) ID() string
func (*BaseProperty) Interface ¶
func (property *BaseProperty) Interface() interface{}
func (*BaseProperty) Json ¶
func (property *BaseProperty) Json() JSON
func (*BaseProperty) Name ¶
func (property *BaseProperty) Name() string
func (*BaseProperty) Type ¶
func (property *BaseProperty) Type() string
type Block ¶
type Block interface {
Object() string
ID() string
CreatedTime() string
LastEditedTime() string
HasChildren() bool
Type() string
Interface() interface{}
Json() JSON
}
func AssignBlock ¶
func NewBlockChildPage ¶
func NewBlockHeading1 ¶
func NewBlockHeading2 ¶
func NewBlockHeading3 ¶
func NewBlockParagraph ¶
func NewBlockToggle ¶
type BlockBulletedListItem ¶
type BlockBulletedListItem struct {
*ChildrenBlock
}
func (*BlockBulletedListItem) Interface ¶
func (block *BlockBulletedListItem) Interface() interface{}
type BlockChildPage ¶
type BlockChildPage struct {
*CustomBlock
}
func (*BlockChildPage) Interface ¶
func (block *BlockChildPage) Interface() interface{}
type BlockHeading1 ¶
type BlockHeading1 struct {
*RichTextBlock
}
func (*BlockHeading1) Interface ¶
func (block *BlockHeading1) Interface() interface{}
type BlockHeading2 ¶
type BlockHeading2 struct {
*RichTextBlock
}
func (*BlockHeading2) Interface ¶
func (block *BlockHeading2) Interface() interface{}
type BlockHeading3 ¶
type BlockHeading3 struct {
*RichTextBlock
}
func (*BlockHeading3) Interface ¶
func (block *BlockHeading3) Interface() interface{}
type BlockNumberedListItem ¶
type BlockNumberedListItem struct {
*ChildrenBlock
}
func (*BlockNumberedListItem) Interface ¶
func (block *BlockNumberedListItem) Interface() interface{}
type BlockParagraph ¶
type BlockParagraph struct {
*RichTextBlock
}
func (*BlockParagraph) Interface ¶
func (block *BlockParagraph) Interface() interface{}
type BlockTodo ¶
type BlockTodo struct {
*ChildrenBlock
}
type BlockToggle ¶
type BlockToggle struct {
*ChildrenBlock
}
func (*BlockToggle) Interface ¶
func (block *BlockToggle) Interface() interface{}
type BlockUnsupported ¶
type BlockUnsupported struct {
*CustomBlock
}
func (*BlockUnsupported) Interface ¶
func (block *BlockUnsupported) Interface() interface{}
type ChildrenBlock ¶
type ChildrenBlock struct {
*RichTextBlock
}
func (*ChildrenBlock) AddChildren ¶
func (block *ChildrenBlock) AddChildren(children []Block) error
func (*ChildrenBlock) Children ¶
func (block *ChildrenBlock) Children() ([]Block, error)
func (*ChildrenBlock) Interface ¶
func (block *ChildrenBlock) Interface() interface{}
type CompoundFilter ¶
type CompoundFilter struct {
JSON JSON
// contains filtered or unexported fields
}
func (*CompoundFilter) Json ¶
func (filter *CompoundFilter) Json() JSON
func (*CompoundFilter) Operation ¶
func (filter *CompoundFilter) Operation() FilterOperation
type Condition ¶
func NewCondition ¶
type ConditionCheckbox ¶
type ConditionCheckbox struct {
Equals ConditionFuncBoolean
DoesNotEqual ConditionFuncBoolean
}
type ConditionDate ¶
type ConditionDate struct {
Equals ConditionFuncString
Before ConditionFuncString
After ConditionFuncString
OnOrBefore ConditionFuncString
IsEmpty ConditionFuncBoolean
IsNotEmpty ConditionFuncBoolean
OnOrAfter ConditionFuncString
PastWeek ConditionFuncObject
PastMonth ConditionFuncObject
PastYear ConditionFuncObject
NextWeek ConditionFuncObject
NextMonth ConditionFuncObject
NextYear ConditionFuncObject
}
type ConditionFiles ¶
type ConditionFiles struct {
IsEmpty ConditionFuncBoolean
IsNotEmpty ConditionFuncBoolean
}
type ConditionFormula ¶
type ConditionFormula struct {
Text *ConditionText
Checkbox *ConditionCheckbox
Number *ConditionNumber
Date *ConditionDate
}
type ConditionFuncBoolean ¶
type ConditionFuncNumber ¶
type ConditionFuncObject ¶
type ConditionFuncObject func(value interface{}) Condition
type ConditionFuncString ¶
type ConditionMultiSelect ¶
type ConditionMultiSelect struct {
Contains ConditionFuncString
DoesNotContain ConditionFuncString
IsEmpty ConditionFuncBoolean
IsNotEmpty ConditionFuncBoolean
}
type ConditionNumber ¶
type ConditionNumber struct {
Equals ConditionFuncNumber
DoesNotEqual ConditionFuncNumber
GreaterThan ConditionFuncNumber
LessThan ConditionFuncNumber
GreaterThanOrEqualTo ConditionFuncNumber
LessThanOrEqualTo ConditionFuncNumber
IsEmpty ConditionFuncBoolean
IsNotEmpty ConditionFuncBoolean
}
type ConditionPeople ¶
type ConditionPeople struct {
Contains ConditionFuncString
DoesNotContain ConditionFuncString
IsEmpty ConditionFuncBoolean
IsNotEmpty ConditionFuncBoolean
}
type ConditionSelect ¶
type ConditionSelect struct {
Equals ConditionFuncString
DoesNotEqual ConditionFuncString
IsEmpty ConditionFuncBoolean
IsNotEmpty ConditionFuncBoolean
}
type ConditionText ¶
type ConditionText struct {
Equals ConditionFuncString
DoesNotEqual ConditionFuncString
Contains ConditionFuncString
DoesNotContain ConditionFuncString
StartsWith ConditionFuncString
EndsWith ConditionFuncString
IsEmpty ConditionFuncBoolean
IsNotEmpty ConditionFuncBoolean
}
type Conditioner ¶
type Conditioner struct {
// contains filtered or unexported fields
}
func (*Conditioner) Key ¶
func (c *Conditioner) Key() string
func (*Conditioner) Type ¶
func (c *Conditioner) Type() string
func (*Conditioner) Value ¶
func (c *Conditioner) Value() interface{}
type Configuration ¶
type Configuration interface {
Name() string
ID() string
Type() string
Json() JSON
Interface() interface{}
}
func AssignConfiguration ¶
func AssignConfiguration(name string, json JSON) (Configuration, error)
type ConfigurationCheckbox ¶
type ConfigurationCheckbox struct {
*BaseConfiguration
}
type ConfigurationDate ¶
type ConfigurationDate struct {
*BaseConfiguration
}
type ConfigurationEmail ¶
type ConfigurationEmail struct {
*BaseConfiguration
}
type ConfigurationFile ¶
type ConfigurationFile struct {
*BaseConfiguration
}
type ConfigurationFormula ¶
type ConfigurationFormula struct {
*BaseConfiguration
}
func (*ConfigurationFormula) Expression ¶
func (configuration *ConfigurationFormula) Expression() string
type ConfigurationMultiSelect ¶
type ConfigurationMultiSelect struct {
*SelectOptionsConfiguration
}
type ConfigurationNumber ¶
type ConfigurationNumber struct {
*BaseConfiguration
}
func (*ConfigurationNumber) Format ¶
func (configuration *ConfigurationNumber) Format() string
type ConfigurationPeople ¶
type ConfigurationPeople struct {
*BaseConfiguration
}
type ConfigurationPhoneNumber ¶
type ConfigurationPhoneNumber struct {
*BaseConfiguration
}
type ConfigurationSelect ¶
type ConfigurationSelect struct {
*SelectOptionsConfiguration
}
type ConfigurationText ¶
type ConfigurationText struct {
*BaseConfiguration
}
type ConfigurationTitle ¶
type ConfigurationTitle struct {
*BaseConfiguration
}
type ConfigurationURL ¶
type ConfigurationURL struct {
*BaseConfiguration
}
type CustomBlock ¶
type CustomBlock struct {
JSON JSON
// contains filtered or unexported fields
}
func (*CustomBlock) CreatedTime ¶
func (block *CustomBlock) CreatedTime() string
func (*CustomBlock) HasChildren ¶
func (block *CustomBlock) HasChildren() bool
func (*CustomBlock) ID ¶
func (block *CustomBlock) ID() string
func (*CustomBlock) Interface ¶
func (block *CustomBlock) Interface() interface{}
func (*CustomBlock) Json ¶
func (block *CustomBlock) Json() JSON
func (*CustomBlock) LastEditedTime ¶
func (block *CustomBlock) LastEditedTime() string
func (*CustomBlock) Object ¶
func (block *CustomBlock) Object() string
func (*CustomBlock) Type ¶
func (block *CustomBlock) Type() string
type Database ¶
type Database struct {
JSON JSON
}
func (*Database) CreatedTime ¶
func (*Database) LastEditedTime ¶
func (*Database) Properties ¶
func (database *Database) Properties() []Configuration
type DatabasePropertyFilter ¶
type DatabasePropertyFilter struct {
JSON JSON
// contains filtered or unexported fields
}
func (*DatabasePropertyFilter) Condition ¶
func (filter *DatabasePropertyFilter) Condition() Condition
func (*DatabasePropertyFilter) Json ¶
func (filter *DatabasePropertyFilter) Json() JSON
func (*DatabasePropertyFilter) Property ¶
func (filter *DatabasePropertyFilter) Property() string
type Filter ¶
type Filter interface {
Json() JSON
}
func NewCompoundFilter ¶
func NewCompoundFilter(Operation FilterOperation, Filters ...Filter) Filter
type FilterOperation ¶
type FilterOperation string
func (FilterOperation) String ¶
func (operation FilterOperation) String() string
type Notion ¶
type Notion struct {
// contains filtered or unexported fields
}
func (*Notion) APIVersion ¶
func (*Notion) AppendBlockChildren ¶
func (*Notion) CreatePage ¶
func (*Notion) ListAllUsers ¶
func (notion *Notion) ListAllUsers(pagination *PaginationRequest) (*PaginationResponse, error)
func (*Notion) ListDatabases ¶
func (notion *Notion) ListDatabases(Pagination *PaginationRequest) (*PaginationResponse, error)
func (*Notion) QueryDatabase ¶
func (notion *Notion) QueryDatabase(DatabaseID string, Pagination *PaginationRequest, Filter Filter, Sorts []Sort) (*PaginationResponse, error)
func (*Notion) RetrieveBlockChildren ¶
func (notion *Notion) RetrieveBlockChildren(BlockID string, pagination *PaginationRequest) (*PaginationResponse, error)
func (*Notion) RetrieveDatabase ¶
func (*Notion) Search ¶
func (notion *Notion) Search(Query string, Pagination *PaginationRequest, Filter Object, Sort *Sort) (*PaginationResponse, error)
type Page ¶
type Page struct {
JSON JSON
}
func (*Page) CreatedTime ¶
func (*Page) LastEditedTime ¶
func (*Page) Properties ¶
type PaginationRequest ¶
type PaginationRequest struct {
StartCursor string `json:"start_cursor"`
PageSize int `json:"page_size"`
}
func (*PaginationRequest) Json ¶
func (request *PaginationRequest) Json() JSON
func (*PaginationRequest) QueryString ¶
func (request *PaginationRequest) QueryString() string
type PaginationResponse ¶
type PaginationResponse struct {
HasMore bool `json:"has_more"`
NextCursor string `json:"next_cursor"`
Object string `json:"object"` //always 'list'
Results []interface{} `json:"results"`
}
func (*PaginationResponse) Blocks ¶
func (response *PaginationResponse) Blocks() ([]Block, error)
func (*PaginationResponse) Databases ¶
func (response *PaginationResponse) Databases() ([]Database, error)
func (*PaginationResponse) Pages ¶
func (response *PaginationResponse) Pages() ([]Page, error)
func (*PaginationResponse) Unmarshal ¶
func (response *PaginationResponse) Unmarshal(v interface{}) error
func (*PaginationResponse) Users ¶
func (response *PaginationResponse) Users() ([]User, error)
type Parent ¶
func NewParentDatabase ¶
func NewParentPage ¶
func NewParentWorkspace ¶
func NewParentWorkspace() *Parent
type Property ¶
type Property interface {
Name() string
ID() string
Type() string
Json() JSON
Interface() interface{}
}
func NewProperty ¶
func NewPropertyCheckbox ¶
func NewPropertyDate ¶
func NewPropertyEmail ¶
func NewPropertyFiles ¶
func NewPropertyFormula ¶
func NewPropertyMultiSelect ¶
func NewPropertyMultiSelect(Name string, Select ...SelectOption) Property
func NewPropertyNumber ¶
func NewPropertyPeople ¶
func NewPropertyPhoneNumber ¶
func NewPropertyRichText ¶
func NewPropertySelect ¶
func NewPropertySelect(Name string, Select *SelectOption) Property
func NewPropertyTitle ¶
func NewPropertyURL ¶
type PropertyCheckbox ¶
type PropertyCheckbox struct {
*BaseProperty
}
func (*PropertyCheckbox) Checked ¶
func (property *PropertyCheckbox) Checked() bool
func (*PropertyCheckbox) Interface ¶
func (property *PropertyCheckbox) Interface() interface{}
type PropertyDate ¶
type PropertyDate struct {
*BaseProperty
}
func (*PropertyDate) Date ¶
func (property *PropertyDate) Date() *Date
func (*PropertyDate) Interface ¶
func (property *PropertyDate) Interface() interface{}
type PropertyEmail ¶
type PropertyEmail struct {
*BaseProperty
}
func (*PropertyEmail) Email ¶
func (property *PropertyEmail) Email() string
func (*PropertyEmail) Interface ¶
func (property *PropertyEmail) Interface() interface{}
type PropertyFiles ¶
type PropertyFiles struct {
*BaseProperty
}
func (*PropertyFiles) Files ¶
func (property *PropertyFiles) Files() []File
func (*PropertyFiles) Interface ¶
func (property *PropertyFiles) Interface() interface{}
type PropertyFormula ¶
type PropertyFormula struct {
*BaseProperty
}
func (*PropertyFormula) Formula ¶
func (property *PropertyFormula) Formula() (Type string, v interface{})
func (*PropertyFormula) Interface ¶
func (property *PropertyFormula) Interface() interface{}
type PropertyMultiSelect ¶
type PropertyMultiSelect struct {
*BaseProperty
}
func (*PropertyMultiSelect) Interface ¶
func (property *PropertyMultiSelect) Interface() interface{}
func (*PropertyMultiSelect) Options ¶
func (property *PropertyMultiSelect) Options() []SelectOption
type PropertyNumber ¶
type PropertyNumber struct {
*BaseProperty
}
func (*PropertyNumber) Interface ¶
func (property *PropertyNumber) Interface() interface{}
func (*PropertyNumber) Number ¶
func (property *PropertyNumber) Number() (int, error)
type PropertyPeople ¶
type PropertyPeople struct {
*BaseProperty
}
func (*PropertyPeople) Interface ¶
func (property *PropertyPeople) Interface() interface{}
func (*PropertyPeople) Users ¶
func (property *PropertyPeople) Users() []User
type PropertyPhoneNumber ¶
type PropertyPhoneNumber struct {
*BaseProperty
}
func (*PropertyPhoneNumber) Interface ¶
func (property *PropertyPhoneNumber) Interface() interface{}
func (*PropertyPhoneNumber) PhoneNumber ¶
func (property *PropertyPhoneNumber) PhoneNumber() string
type PropertyRichText ¶
type PropertyRichText struct {
*RichTextProperty
}
func (*PropertyRichText) Interface ¶
func (property *PropertyRichText) Interface() interface{}
type PropertySelect ¶
type PropertySelect struct {
*BaseProperty
}
func (*PropertySelect) Interface ¶
func (property *PropertySelect) Interface() interface{}
func (*PropertySelect) Option ¶
func (property *PropertySelect) Option() *SelectOption
type PropertyTitle ¶
type PropertyTitle struct {
*RichTextProperty
}
func (*PropertyTitle) Interface ¶
func (property *PropertyTitle) Interface() interface{}
type PropertyURL ¶
type PropertyURL struct {
*BaseProperty
}
func (*PropertyURL) Interface ¶
func (property *PropertyURL) Interface() interface{}
func (*PropertyURL) URL ¶
func (property *PropertyURL) URL() string
type RichText ¶
type RichText struct {
JSON JSON
}
func NewRichText ¶
func (*RichText) GetAnnotations ¶
func (rt *RichText) GetAnnotations() (*Annotations, error)
func (*RichText) GetEquation ¶
func (*RichText) GetMentionDatabase ¶
func (*RichText) GetMentionDate ¶
func (*RichText) GetMentionPage ¶
func (*RichText) GetMentionUser ¶
func (*RichText) SetAnnotations ¶
func (rt *RichText) SetAnnotations(annotations *Annotations)
func (*RichText) SetEquation ¶
func (*RichText) SetMentionDatabase ¶
func (*RichText) SetMentionDate ¶
func (*RichText) SetMentionPage ¶
func (*RichText) SetMentionUser ¶
type RichTextBlock ¶
type RichTextBlock struct {
*CustomBlock
}
func (*RichTextBlock) AddText ¶
func (block *RichTextBlock) AddText(text []RichText) error
func (*RichTextBlock) Interface ¶
func (block *RichTextBlock) Interface() interface{}
func (*RichTextBlock) ListText ¶
func (block *RichTextBlock) ListText() ([]RichText, error)
type RichTextProperty ¶
type RichTextProperty struct {
*BaseProperty
}
func (*RichTextProperty) Interface ¶
func (property *RichTextProperty) Interface() interface{}
func (*RichTextProperty) RichText ¶
func (property *RichTextProperty) RichText() []RichText
type SelectOption ¶
type SelectOptionsConfiguration ¶
type SelectOptionsConfiguration struct {
*BaseConfiguration
}
func (*SelectOptionsConfiguration) Options ¶
func (configuration *SelectOptionsConfiguration) Options() []SelectOption
Source Files
¶
Click to show internal directories.
Click to hide internal directories.