File tree Expand file tree Collapse file tree 5 files changed +12
-8
lines changed Expand file tree Collapse file tree 5 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,7 @@ const (
180180ParentTypeDatabaseID ParentType = "database_id"
181181ParentTypePageID ParentType = "page_id"
182182ParentTypeWorkspace ParentType = "workspace"
183+ ParentTypeBlockID ParentType = "block_id"
183184)
184185
185186const (
Original file line number Diff line number Diff line change @@ -195,8 +195,8 @@ func TestDatabaseClient(t *testing.T) {
195195CreatedBy : user ,
196196LastEditedBy : user ,
197197Parent : notionapi.Parent {
198- Type : "page_id " ,
199- PageID : "48f8fee9-cd79-4180-bc2f-ec0398253067" ,
198+ Type : "block_id " ,
199+ BlockID : "48f8fee9-cd79-4180-bc2f-ec0398253067" ,
200200},
201201Title : []notionapi.RichText {
202202{
@@ -265,8 +265,8 @@ func TestDatabaseClient(t *testing.T) {
265265CreatedBy : user ,
266266LastEditedBy : user ,
267267Parent : notionapi.Parent {
268- Type : "page_id " ,
269- PageID : "a7744006-9233-4cd0-bf44-3a49de2c01b5" ,
268+ Type : "block_id " ,
269+ BlockID : "a7744006-9233-4cd0-bf44-3a49de2c01b5" ,
270270},
271271Title : []notionapi.RichText {
272272{
Original file line number Diff line number Diff line change @@ -101,10 +101,13 @@ func (p *Page) GetObject() ObjectType {
101101
102102type ParentType string
103103
104+ // Ref: https://developers.notion.com/reference/parent-object
104105type Parent struct {
105106Type ParentType `json:"type,omitempty"`
106107PageID PageID `json:"page_id,omitempty"`
107108DatabaseID DatabaseID `json:"database_id,omitempty"`
109+ BlockID BlockID `json:"block_id,omitempty"`
110+ Workspace bool `json:"workspace,omitempty"`
108111}
109112
110113type PageCreateRequest struct {
Original file line number Diff line number Diff line change 4141 }
4242 ],
4343 "parent" : {
44- "type" : " page_id " ,
45- "page_id " : " a7744006-9233-4cd0-bf44-3a49de2c01b5"
44+ "type" : " block_id " ,
45+ "block_id " : " a7744006-9233-4cd0-bf44-3a49de2c01b5"
4646 }
4747}
Original file line number Diff line number Diff line change 1212 "id" : " some_id"
1313 },
1414 "parent" : {
15- "type" : " page_id " ,
16- "page_id " : " 48f8fee9-cd79-4180-bc2f-ec0398253067"
15+ "type" : " block_id " ,
16+ "block_id " : " 48f8fee9-cd79-4180-bc2f-ec0398253067"
1717 },
1818 "icon" : {
1919 "type" : " emoji" ,
You can’t perform that action at this time.
0 commit comments