mirror of
https://github.com/dstotijn/go-notion.git
synced 2025-06-17 00:07:45 +02:00
Enumerate rollup function values
This commit is contained in:
@ -191,7 +191,7 @@ func TestFindDatabaseByID(t *testing.T) {
|
||||
"relation_property_name": "Meals",
|
||||
"rollup_property_id": "title",
|
||||
"relation_property_id": "mxp^",
|
||||
"function": "count"
|
||||
"function": "count_all"
|
||||
}
|
||||
},
|
||||
"Store availability": {
|
||||
@ -322,7 +322,7 @@ func TestFindDatabaseByID(t *testing.T) {
|
||||
RelationPropName: "Meals",
|
||||
RollupPropID: "title",
|
||||
RelationPropID: "mxp^",
|
||||
Function: "count",
|
||||
Function: notion.RollupFunctionCountAll,
|
||||
},
|
||||
},
|
||||
"Store availability": notion.DatabaseProperty{
|
||||
|
21
database.go
21
database.go
@ -43,10 +43,29 @@ type (
|
||||
RelationPropID string `json:"relation_property_id,omitempty"`
|
||||
RollupPropName string `json:"rollup_property_name,omitempty"`
|
||||
RollupPropID string `json:"rollup_property_id,omitempty"`
|
||||
Function string `json:"function,omitempty"`
|
||||
Function RollupFunction `json:"function,omitempty"`
|
||||
}
|
||||
)
|
||||
|
||||
type RollupFunction string
|
||||
|
||||
const (
|
||||
RollupFunctionCountAll RollupFunction = "count_all"
|
||||
RollupFunctionCountValues RollupFunction = "count_values"
|
||||
RollupFunctionCountUniqueValues RollupFunction = "count_unique_values"
|
||||
RollupFunctionCountEmpty RollupFunction = "count_empty"
|
||||
RollupFunctionCountNotEmpty RollupFunction = "count_not_empty"
|
||||
RollupFunctionPercentEmpty RollupFunction = "percent_empty"
|
||||
RollupFunctionPercentNotEmpty RollupFunction = "percent_not_empty"
|
||||
RollupFunctionSum RollupFunction = "sum"
|
||||
RollupFunctionAverage RollupFunction = "average"
|
||||
RollupFunctionMedian RollupFunction = "median"
|
||||
RollupFunctionMin RollupFunction = "min"
|
||||
RollupFunctionMax RollupFunction = "max"
|
||||
RollupFunctionRange RollupFunction = "range"
|
||||
RollupFunctionShowOriginal RollupFunction = "show_original"
|
||||
)
|
||||
|
||||
type SelectOptions struct {
|
||||
ID string `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
|
Reference in New Issue
Block a user