Skip to content

Commit 984d279

Browse files
Add created by and last edited by properties
1 parent 0940133 commit 984d279

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed

Src/Notion.Client/Models/Blocks/Block.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,9 @@ public abstract class Block : IBlock
1515
public DateTime LastEditedTime { get; set; }
1616

1717
public virtual bool HasChildren { get; set; }
18+
19+
public PartialUser CreatedBy { get; set; }
20+
21+
public PartialUser LastEditedBy { get; set; }
1822
}
1923
}

Src/Notion.Client/Models/Common/IObjectModificationData.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,17 @@ public interface IObjectModificationData
1616
/// </summary>
1717
[JsonProperty("last_edited_time")]
1818
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; }
1931
}
2032
}

Src/Notion.Client/Models/Database/Database.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,9 @@ public class Database : IObject, IObjectModificationData
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
}

Src/Notion.Client/Models/Page/Page.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,9 @@ public class Page : IObject, IObjectModificationData
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
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
}

0 commit comments

Comments
 (0)