File tree Expand file tree Collapse file tree 5 files changed +20
-4
lines changed Expand file tree Collapse file tree 5 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ namespace Notion.Client
1515 [ JsonSubtypes . KnownSubType ( typeof ( ToDoBlock ) , BlockType . ToDo ) ]
1616 [ JsonSubtypes . KnownSubType ( typeof ( ToggleBlock ) , BlockType . Toggle ) ]
1717 [ JsonSubtypes . KnownSubType ( typeof ( UnsupportedBlock ) , BlockType . Unsupported ) ]
18- public class Block
18+ public class Block : IObject
1919 {
2020 public ObjectType Object => ObjectType . Block ;
2121 public string Id { get ; set ; }
Original file line number Diff line number Diff line change 44
55namespace Notion . Client
66{
7- public class Database
7+ public class Database : IObject
88 {
99 public ObjectType Object => ObjectType . Database ;
1010 public string Id { get ; set ; }
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 ) , "object" ) ]
7+ [ JsonSubtypes . KnownSubType ( typeof ( Page ) , ObjectType . Page ) ]
8+ [ JsonSubtypes . KnownSubType ( typeof ( Database ) , ObjectType . Database ) ]
9+ [ JsonSubtypes . KnownSubType ( typeof ( Block ) , ObjectType . Block ) ]
10+ [ JsonSubtypes . KnownSubType ( typeof ( User ) , ObjectType . User ) ]
11+ public interface IObject
12+ {
13+ string Id { get ; set ; }
14+ ObjectType Object { get ; }
15+ }
16+ }
Original file line number Diff line number Diff line change 44
55namespace Notion . Client
66{
7- public class Page
7+ public class Page : IObject
88 {
99 public ObjectType Object => ObjectType . Page ;
1010 public string Id { get ; set ; }
Original file line number Diff line number Diff line change 22
33namespace Notion . Client
44{
5- public class User
5+ public class User : IObject
66 {
77 public ObjectType Object => ObjectType . User ;
88 public string Id { get ; set ; }
You can’t perform that action at this time.
0 commit comments