File tree Expand file tree Collapse file tree 5 files changed +28
-12
lines changed
Expand file tree Collapse file tree 5 files changed +28
-12
lines changed Original file line number Diff line number Diff line change 1- namespace Notion . Client
1+ using System ;
2+
3+ namespace Notion . Client
24{
35 public abstract class Block : IBlock
46 {
@@ -8,9 +10,9 @@ public abstract class Block : IBlock
810
911 public virtual BlockType Type { get ; set ; }
1012
11- public string CreatedTime { get ; set ; }
13+ public DateTime CreatedTime { get ; set ; }
1214
13- public string LastEditedTime { get ; set ; }
15+ public DateTime LastEditedTime { get ; set ; }
1416
1517 public virtual bool HasChildren { get ; set ; }
1618 }
Original file line number Diff line number Diff line change @@ -36,18 +36,12 @@ namespace Notion.Client
3636 [ JsonSubtypes . KnownSubType ( typeof ( ToggleBlock ) , BlockType . Toggle ) ]
3737 [ JsonSubtypes . KnownSubType ( typeof ( VideoBlock ) , BlockType . Video ) ]
3838 [ JsonSubtypes . KnownSubType ( typeof ( UnsupportedBlock ) , BlockType . Unsupported ) ]
39- public interface IBlock : IObject
39+ public interface IBlock : IObject , IObjectModificationData
4040 {
4141 [ JsonProperty ( "type" ) ]
4242 [ JsonConverter ( typeof ( StringEnumConverter ) ) ]
4343 BlockType Type { get ; set ; }
4444
45- [ JsonProperty ( "created_time" ) ]
46- string CreatedTime { get ; set ; }
47-
48- [ JsonProperty ( "last_edited_time" ) ]
49- string LastEditedTime { get ; set ; }
50-
5145 [ JsonProperty ( "has_children" ) ]
5246 bool HasChildren { get ; set ; }
5347 }
Original file line number Diff line number Diff line change 1+ using System ;
2+ using Newtonsoft . Json ;
3+
4+ namespace Notion . Client
5+ {
6+ public interface IObjectModificationData
7+ {
8+ /// <summary>
9+ /// Date and time when this object was created.
10+ /// </summary>
11+ [ JsonProperty ( "created_time" ) ]
12+ DateTime CreatedTime { get ; set ; }
13+
14+ /// <summary>
15+ /// Date and time when this object was updated.
16+ /// </summary>
17+ [ JsonProperty ( "last_edited_time" ) ]
18+ DateTime LastEditedTime { get ; set ; }
19+ }
20+ }
Original file line number Diff line number Diff line change 44
55namespace Notion . Client
66{
7- public class Database : IObject
7+ public class Database : IObject , IObjectModificationData
88 {
99 public ObjectType Object => ObjectType . Database ;
1010
Original file line number Diff line number Diff line change 44
55namespace Notion . Client
66{
7- public class Page : IObject
7+ public class Page : IObject , IObjectModificationData
88 {
99 /// <summary>
1010 /// Object type
You can’t perform that action at this time.
0 commit comments