model

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2021 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

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

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 *Database) ExtractColumnTitleId() (string, error)

func (*Database) ExtractTitle added in v0.3.0

func (database *Database) ExtractTitle() string

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 DatabasePropertyValue struct {
	ID    string      `json:"id"`
	Type  string      `json:"type"`
	Title *[]RichText `json:"title,omitempty"`
}

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

func (page *Page) ExtractPageTitle() (string, error)

todo clean solution to properties

type PagePatch added in v0.3.0

type PagePatch struct {
	Properties *map[string]interface{} `json:"properties,omitempty"`
	Parent     *Parent                 `json:"parent,omitempty"`
	Archived   bool                    `json:"archived,omitempty"`
	Url        *string                 `json:"url,omitempty"`
}

func NewPage added in v0.3.0

func NewPage(title string, parent Parent) PagePatch

type PagePropertyValue added in v0.3.0

type PagePropertyValue struct {
	Type  string      `json:"type"`
	Id    *string     `json:"id,omitempty"`
	Title *[]RichText `json:"title,omitempty"`
}

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 NewParentFromDatabaseId(databaseId string) Parent

func NewParentFromPageId

func NewParentFromPageId(pageId string) Parent

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

func NewRichText(text string) RichText

func (*RichText) Get

func (richText *RichText) Get() string

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 SelectOption struct {
	Name  string `json:"name"`
	Color string `json:"color"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL