Documentation
¶
Index ¶
- Constants
- Variables
- type Annotations
- type Database
- type DatabaseProperty
- func NewBasicDatabaseProperty(name *string, propertyType string) DatabaseProperty
- func NewMultiDatabaseProperty(name *string, options *[]SelectOption) DatabaseProperty
- func NewNumberDatabaseProperty(name *string, format *string) DatabaseProperty
- func NewRelationDatabaseProperty(name *string, databaseId string) DatabaseProperty
- func NewRollupDatabaseProperty(name *string, rollupPropertyName string, relationPropertyName string, ...) DatabaseProperty
- func NewSelectDatabaseProperty(name *string, options *[]SelectOption) DatabaseProperty
- func NewTitleDatabaseProperty(name string) DatabaseProperty
- type DatabasePropertyValue
- type MultiSelectDatabasePropertyInfo
- type NumberDatabasePropertyInfo
- type Page
- type PagePatch
- type PagePropertyValue
- type Parent
- type RelationDatabasePropertyInfo
- type RichText
- type RollupDatabasePropertyInfo
- type RollupFunction
- type SelectDatabasePropertyInfo
- type SelectOption
- type Text
- type User
- type UserPerson
Constants ¶
View Source
const ( CountAll RollupFunction = "count_all" CountValues = "count_values" CountUniqueValues = "count_unique_values" CountEmpty = "count_empty" CountNotEmpty = "count_not_empty" PercentEmpty = "percent_empty" PercentNotEmpty = "percent_not_empty" Sum = "sum" Average = "average" Median = "median" Min = "min" Max = "max" Range = "range" ShowOriginal = "show_original" )
Variables ¶
View Source
var RollupFunctions = [...]RollupFunction{ CountAll, CountValues, CountUniqueValues, CountEmpty, CountNotEmpty, PercentEmpty, PercentNotEmpty, Sum, Average, Median, Min, Max, Range, ShowOriginal, }
Functions ¶
This section is empty.
Types ¶
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
type Database ¶
type Database struct { Object string `json:"object,omitempty"` Id *string `json:"id,omitempty"` Url *string `json:"url,omitempty"` CreatedTime *time.Time `json:"created_time,omitempty"` LastEditedTime *time.Time `json:"last_edited_time,omitempty"` Title []RichText `json:"title,omitempty"` Properties map[string]DatabaseProperty `json:"properties,omitempty"` Parent *Parent `json:"parent,omitempty"` }
func NewDatabase ¶
func NewDatabase(title string, parent Parent, properties map[string]DatabaseProperty) Database
func (*Database) ExtractColumnTitleId ¶ added in v0.0.9
func (*Database) ExtractTitle ¶ added in v0.3.0
type DatabaseProperty ¶
type DatabaseProperty struct { ID *string `json:"id,omitempty"` Type *string `json:"type,omitempty"` Name *string `json:"name,omitempty"` Title *struct{} `json:"title,omitempty"` RichText *struct{} `json:"rich_text,omitempty"` Date *struct{} `json:"date,omitempty"` People *struct{} `json:"people,omitempty"` File *struct{} `json:"file,omitempty"` Checkbox *struct{} `json:"checkbox,omitempty"` Url *struct{} `json:"url,omitempty"` Email *struct{} `json:"email,omitempty"` CreatedTime *struct{} `json:"created_time,omitempty"` CreatedBy *struct{} `json:"created_by,omitempty"` LastEditedTime *struct{} `json:"last_edited_time,omitempty"` LastEditedBy *struct{} `json:"last_edited_by,omitempty"` Number *NumberDatabasePropertyInfo `json:"number,omitempty"` Relation *RelationDatabasePropertyInfo `json:"relation,omitempty"` Rollup *RollupDatabasePropertyInfo `json:"rollup,omitempty"` Select *SelectDatabasePropertyInfo `json:"select,omitempty"` MultiSelect *MultiSelectDatabasePropertyInfo `json:"multi_select,omitempty"` }
func NewBasicDatabaseProperty ¶
func NewBasicDatabaseProperty(name *string, propertyType string) DatabaseProperty
func NewMultiDatabaseProperty ¶
func NewMultiDatabaseProperty(name *string, options *[]SelectOption) DatabaseProperty
func NewNumberDatabaseProperty ¶
func NewNumberDatabaseProperty(name *string, format *string) DatabaseProperty
func NewRelationDatabaseProperty ¶ added in v0.0.9
func NewRelationDatabaseProperty(name *string, databaseId string) DatabaseProperty
func NewRollupDatabaseProperty ¶ added in v0.0.9
func NewRollupDatabaseProperty(name *string, rollupPropertyName string, relationPropertyName string, function RollupFunction) DatabaseProperty
func NewSelectDatabaseProperty ¶
func NewSelectDatabaseProperty(name *string, options *[]SelectOption) DatabaseProperty
func NewTitleDatabaseProperty ¶
func NewTitleDatabaseProperty(name string) DatabaseProperty
type DatabasePropertyValue ¶
type MultiSelectDatabasePropertyInfo ¶
type MultiSelectDatabasePropertyInfo struct {
Options *[]SelectOption `json:"options,omitempty"`
}
type NumberDatabasePropertyInfo ¶
type NumberDatabasePropertyInfo struct {
Format *string `json:"format,omitempty"`
}
type Page ¶
type Page struct { Object string `json:"object,omitempty"` Id *string `json:"id,omitempty"` CreatedTime *time.Time `json:"created_time,omitempty"` LastEditedTime *time.Time `json:"last_edited_time,omitempty"` Title []RichText `json:"title,omitempty"` Properties *map[string]PagePropertyValue `json:"properties,omitempty"` Parent *Parent `json:"parent,omitempty"` Url *string `json:"url,omitempty"` }
func (*Page) ExtractPageTitle ¶ added in v0.3.0
todo clean solution to properties
type PagePatch ¶ added in v0.3.0
type PagePropertyValue ¶ added in v0.3.0
type Parent ¶
type Parent struct { Type string `json:"type,omitempty"` Workspace bool `json:"workspace,omitempty"` PageId string `json:"page_id,omitempty"` DatabaseId string `json:"database_id,omitempty"` }
func NewParentFromData ¶ added in v0.3.0
func NewParentFromData(data *schema.ResourceData) Parent
func NewParentFromDatabaseId ¶ added in v0.3.0
func NewParentFromPageId ¶
func NewWorkspacePageParent ¶ added in v0.3.0
func NewWorkspacePageParent() Parent
type RelationDatabasePropertyInfo ¶ added in v0.0.9
type RelationDatabasePropertyInfo struct {
DatabaseId string `json:"database_id"`
}
type RichText ¶
type RichText struct { Type string `json:"type"` Text Text `json:"text"` Annotations *Annotations `json:"annotations,omitempty"` PlainText *string `json:"plain_text,omitempty"` Href interface{} `json:"href,omitempty"` }
func NewRichText ¶
type RollupDatabasePropertyInfo ¶ added in v0.0.9
type RollupDatabasePropertyInfo struct { RelationPropertyName string `json:"relation_property_name"` RollupPropertyName string `json:"rollup_property_name"` Function RollupFunction `json:"function"` }
type RollupFunction ¶ added in v0.0.9
type RollupFunction string
type SelectDatabasePropertyInfo ¶
type SelectDatabasePropertyInfo struct {
Options *[]SelectOption `json:"options,omitempty"`
}
type SelectOption ¶
type Text ¶
type Text struct { Content string `json:"content"` Link interface{} `json:"link,omitempty"` }
type User ¶
type User struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Person *UserPerson `json:"person"` }
type UserPerson ¶
type UserPerson struct {
Email string `json:"email"`
}
Click to show internal directories.
Click to hide internal directories.