Skip to content

Commit 5ec0c95

Browse files
Add interface for Wiki database
1 parent 95d0b68 commit 5ec0c95

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Notion.Client
66
{
7-
public class Database : IObject, IObjectModificationData
7+
public class Database : IObject, IObjectModificationData, IWikiDatabase
88
{
99
[JsonProperty("title")]
1010
public List<RichTextBase> Title { get; set; }
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using JsonSubTypes;
2+
using Newtonsoft.Json;
3+
4+
namespace Notion.Client
5+
{
6+
[JsonConverter(typeof(JsonSubtypes), "object")]
7+
[JsonSubtypes.KnownSubTypeAttribute(typeof(Page), ObjectType.Page)]
8+
[JsonSubtypes.KnownSubTypeAttribute(typeof(Database), ObjectType.Database)]
9+
public interface IWikiDatabase : IObject
10+
{
11+
12+
}
13+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Notion.Client
66
{
7-
public class Page : IObject, IObjectModificationData
7+
public class Page : IObject, IObjectModificationData, IWikiDatabase
88
{
99
/// <summary>
1010
/// The parent of this page. Can be a database, page, or workspace.

0 commit comments

Comments
 (0)