From f2d0781cce3a26867ad3369d0508928388024934 Mon Sep 17 00:00:00 2001 From: Vedant Koditkar Date: Sun, 21 Aug 2022 03:14:01 +0530 Subject: [PATCH] Fix Block parent parsing --- Src/Notion.Client/Models/Blocks/Block.cs | 1 - Src/Notion.Client/Models/Blocks/IBlock.cs | 1 - Src/Notion.Client/Models/Blocks/IBlockParent.cs | 4 ++-- Src/Notion.Client/Models/Parents/BlockParent.cs | 2 +- Src/Notion.Client/Models/Parents/DatabaseParent.cs | 2 +- Src/Notion.Client/Models/Parents/PageParent.cs | 2 +- Src/Notion.Client/Models/Parents/WorkspaceParent.cs | 2 +- 7 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Src/Notion.Client/Models/Blocks/Block.cs b/Src/Notion.Client/Models/Blocks/Block.cs index 1baf2533..81bcd6bb 100644 --- a/Src/Notion.Client/Models/Blocks/Block.cs +++ b/Src/Notion.Client/Models/Blocks/Block.cs @@ -1,5 +1,4 @@ using System; -using Notion.Client.Models.Blocks; namespace Notion.Client { diff --git a/Src/Notion.Client/Models/Blocks/IBlock.cs b/Src/Notion.Client/Models/Blocks/IBlock.cs index 58b17b93..70cd9755 100644 --- a/Src/Notion.Client/Models/Blocks/IBlock.cs +++ b/Src/Notion.Client/Models/Blocks/IBlock.cs @@ -1,7 +1,6 @@ using JsonSubTypes; using Newtonsoft.Json; using Newtonsoft.Json.Converters; -using Notion.Client.Models.Blocks; namespace Notion.Client { diff --git a/Src/Notion.Client/Models/Blocks/IBlockParent.cs b/Src/Notion.Client/Models/Blocks/IBlockParent.cs index 4e1d7a17..73634400 100644 --- a/Src/Notion.Client/Models/Blocks/IBlockParent.cs +++ b/Src/Notion.Client/Models/Blocks/IBlockParent.cs @@ -1,14 +1,14 @@ using JsonSubTypes; using Newtonsoft.Json; -namespace Notion.Client.Models.Blocks +namespace Notion.Client { [JsonConverter(typeof(JsonSubtypes), "type")] [JsonSubtypes.KnownSubType(typeof(DatabaseParent), ParentType.DatabaseId)] [JsonSubtypes.KnownSubType(typeof(PageParent), ParentType.PageId)] [JsonSubtypes.KnownSubType(typeof(WorkspaceParent), ParentType.Workspace)] [JsonSubtypes.KnownSubType(typeof(BlockParent), ParentType.BlockId)] - public interface IBlockParent + public interface IBlockParent : IParent { } } diff --git a/Src/Notion.Client/Models/Parents/BlockParent.cs b/Src/Notion.Client/Models/Parents/BlockParent.cs index e0a9af48..5cff9458 100644 --- a/Src/Notion.Client/Models/Parents/BlockParent.cs +++ b/Src/Notion.Client/Models/Parents/BlockParent.cs @@ -2,7 +2,7 @@ namespace Notion.Client { - public class BlockParent : IPageParent, IDatabaseParent + public class BlockParent : IPageParent, IDatabaseParent, IBlockParent { /// /// Always has a value "block_id" diff --git a/Src/Notion.Client/Models/Parents/DatabaseParent.cs b/Src/Notion.Client/Models/Parents/DatabaseParent.cs index c3e028e7..2e680655 100644 --- a/Src/Notion.Client/Models/Parents/DatabaseParent.cs +++ b/Src/Notion.Client/Models/Parents/DatabaseParent.cs @@ -2,7 +2,7 @@ namespace Notion.Client { - public class DatabaseParent : IPageParent + public class DatabaseParent : IPageParent, IBlockParent { /// /// Always "database_id" diff --git a/Src/Notion.Client/Models/Parents/PageParent.cs b/Src/Notion.Client/Models/Parents/PageParent.cs index ff185747..a1f32a01 100644 --- a/Src/Notion.Client/Models/Parents/PageParent.cs +++ b/Src/Notion.Client/Models/Parents/PageParent.cs @@ -2,7 +2,7 @@ namespace Notion.Client { - public class PageParent : IPageParent, IDatabaseParent + public class PageParent : IPageParent, IDatabaseParent, IBlockParent { /// /// Always "page_id". diff --git a/Src/Notion.Client/Models/Parents/WorkspaceParent.cs b/Src/Notion.Client/Models/Parents/WorkspaceParent.cs index fc645b60..86c60a54 100644 --- a/Src/Notion.Client/Models/Parents/WorkspaceParent.cs +++ b/Src/Notion.Client/Models/Parents/WorkspaceParent.cs @@ -1,6 +1,6 @@ namespace Notion.Client { - public class WorkspaceParent : IPageParent, IDatabaseParent + public class WorkspaceParent : IPageParent, IDatabaseParent, IBlockParent { /// /// Always "workspace".