File tree Expand file tree Collapse file tree 4 files changed +17
-2
lines changed
Expand file tree Collapse file tree 4 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ namespace Notion.Client
77 public class Database : IObject
88 {
99 public ObjectType Object => ObjectType . Database ;
10+
1011 public string Id { get ; set ; }
1112
1213 [ JsonProperty ( "created_time" ) ]
@@ -18,5 +19,7 @@ public class Database : IObject
1819 public List < RichTextBase > Title { get ; set ; }
1920
2021 public Dictionary < string , Property > Properties { get ; set ; }
22+
23+ public IDatabaseParent Parent { get ; set ; }
2124 }
2225}
Original file line number Diff line number Diff line change 1+ using JsonSubTypes ;
2+ using Newtonsoft . Json ;
3+
4+ namespace Notion . Client
5+ {
6+ [ JsonConverter ( typeof ( JsonSubtypes ) , "type" ) ]
7+ [ JsonSubtypes . KnownSubType ( typeof ( PageParent ) , ParentType . PageId ) ]
8+ [ JsonSubtypes . KnownSubType ( typeof ( WorkspaceParent ) , ParentType . Workspace ) ]
9+ public interface IDatabaseParent : IParent
10+ {
11+ }
12+ }
Original file line number Diff line number Diff line change 22
33namespace Notion . Client
44{
5- public class PageParent : IPageParent
5+ public class PageParent : IPageParent , IDatabaseParent
66 {
77 [ JsonProperty ( "page_id" ) ]
88 public string PageId { get ; set ; }
Original file line number Diff line number Diff line change 11namespace Notion . Client
22{
3- public class WorkspaceParent : IPageParent
3+ public class WorkspaceParent : IPageParent , IDatabaseParent
44 {
55 public ParentType Type { get ; set ; }
66 }
You can’t perform that action at this time.
0 commit comments