File tree Expand file tree Collapse file tree 7 files changed +63
-14
lines changed Expand file tree Collapse file tree 7 files changed +63
-14
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,10 +10,14 @@ 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 ; }
18+
19+ public PartialUser CreatedBy { get ; set ; }
20+
21+ public PartialUser LastEditedBy { get ; set ; }
1622 }
1723}
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+ /// <summary>
21+ /// User who created the object.
22+ /// </summary>
23+ [ JsonProperty ( "created_by" ) ]
24+ PartialUser CreatedBy { get ; set ; }
25+
26+ /// <summary>
27+ /// User who last modified the object.
28+ /// </summary>
29+ [ JsonProperty ( "last_edited_by" ) ]
30+ PartialUser LastEditedBy { get ; set ; }
31+ }
32+ }
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
@@ -36,5 +36,9 @@ public class Database : IObject
3636 /// </summary>
3737 [ JsonProperty ( "url" ) ]
3838 public string Url { get ; set ; }
39+
40+ public PartialUser CreatedBy { get ; set ; }
41+
42+ public PartialUser LastEditedBy { get ; set ; }
3943 }
4044}
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
@@ -63,5 +63,9 @@ public class Page : IObject
6363 /// </summary>
6464 [ JsonProperty ( "cover" ) ]
6565 public FileObject Cover { get ; set ; }
66+
67+ public PartialUser CreatedBy { get ; set ; }
68+
69+ public PartialUser LastEditedBy { get ; set ; }
6670 }
6771}
Original file line number Diff line number Diff line change 1+ namespace Notion . Client
2+ {
3+ public class PartialUser : IObject
4+ {
5+ public string Id { get ; set ; }
6+
7+ public ObjectType Object => ObjectType . User ;
8+ }
9+ }
Original file line number Diff line number Diff line change 2222 </PackageReference >
2323 <PackageReference Include =" Newtonsoft.Json" Version =" 13.0.1" />
2424 <PackageReference Include =" JsonSubTypes" Version =" 1.8.0" />
25- <PackageReference Include =" Microsoft.Extensions.Logging.Abstractions" Version =" 5.0.0" />
26- <PackageReference Include =" Microsoft.Extensions.DependencyInjection.Abstractions" Version =" 5.0.0" />
25+ <PackageReference Include =" Microsoft.Extensions.Logging.Abstractions" Version =" 5.0.0" />
26+ <PackageReference Include =" Microsoft.Extensions.DependencyInjection.Abstractions" Version =" 5.0.0" />
2727 </ItemGroup >
2828
2929 <ItemGroup >
You can’t perform that action at this time.
0 commit comments