File tree Expand file tree Collapse file tree 7 files changed +84
-67
lines changed Expand file tree Collapse file tree 7 files changed +84
-67
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ using Newtonsoft . Json ;
2+
3+ namespace Notion . Client
4+ {
5+ public class DatabaseParent : Parent
6+ {
7+ [ JsonProperty ( "database_id" ) ]
8+ public string DatabaseId { get ; set ; }
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+ using Newtonsoft . Json ;
4+
5+ namespace Notion . Client
6+ {
7+ public class Page
8+ {
9+ public string Object => "page" ;
10+ public string Id { get ; set ; }
11+ public Parent Parent { get ; set ; }
12+
13+ [ JsonProperty ( "created_time" ) ]
14+ public DateTime CreatedTime { get ; set ; }
15+
16+ [ JsonProperty ( "last_edited_time" ) ]
17+ public DateTime LastEditedTime { get ; set ; }
18+
19+ [ JsonProperty ( "archived" ) ]
20+ public bool IsArchived { get ; set ; }
21+
22+ public IDictionary < string , PropertyValue > Properties { get ; set ; }
23+ }
24+ }
Original file line number Diff line number Diff line change 1+ using Newtonsoft . Json ;
2+
3+ namespace Notion . Client
4+ {
5+ public class PageParent : Parent
6+ {
7+ [ JsonProperty ( "page_id" ) ]
8+ public string PageId { get ; set ; }
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ using JsonSubTypes ;
2+ using Newtonsoft . Json ;
3+ using Newtonsoft . Json . Converters ;
4+
5+ namespace Notion . Client
6+ {
7+ [ JsonConverter ( typeof ( JsonSubtypes ) , "type" ) ]
8+ [ JsonSubtypes . KnownSubType ( typeof ( DatabaseParent ) , ParentType . DatabaseId ) ]
9+ [ JsonSubtypes . KnownSubType ( typeof ( PageParent ) , ParentType . PageId ) ]
10+ [ JsonSubtypes . KnownSubType ( typeof ( WorkspaceParent ) , ParentType . Workspace ) ]
11+ public class Parent
12+ {
13+ [ JsonConverter ( typeof ( StringEnumConverter ) ) ]
14+ public ParentType Type { get ; set ; }
15+ }
16+ }
Original file line number Diff line number Diff line change 1+ using System . Runtime . Serialization ;
2+
3+ namespace Notion . Client
4+ {
5+ public enum ParentType
6+ {
7+ [ EnumMember ( Value = null ) ]
8+ Unknown ,
9+
10+ [ EnumMember ( Value = "database_id" ) ]
11+ DatabaseId ,
12+
13+ [ EnumMember ( Value = "page_id" ) ]
14+ PageId ,
15+ [ EnumMember ( Value = "workspace" ) ]
16+ Workspace
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ namespace Notion . Client
2+ {
3+ public class WorkspaceParent : Parent
4+ {
5+ }
6+ }
You can’t perform that action at this time.
0 commit comments