Skip to content

Commit ad84cfd

Browse files
Add support for link_to_page block type ✨
1 parent 492fb02 commit ad84cfd

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Notion.Client
4+
{
5+
public class LinkToPageUpdateBlock : UpdateBlock, IUpdateBlock
6+
{
7+
[JsonProperty("link_to_page")]
8+
public IPageParentInput LinkToPage { get; set; }
9+
}
10+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ public enum BlockType
8585
[EnumMember(Value = "template")]
8686
Template,
8787

88+
[EnumMember(Value = "link_to_page")]
89+
LinkToPage,
90+
8891
[EnumMember(Value = "unsupported")]
8992
Unsupported
9093
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ namespace Notion.Client
2323
[JsonSubtypes.KnownSubType(typeof(HeadingTwoBlock), BlockType.Heading_2)]
2424
[JsonSubtypes.KnownSubType(typeof(HeadingThreeeBlock), BlockType.Heading_3)]
2525
[JsonSubtypes.KnownSubType(typeof(ImageBlock), BlockType.Image)]
26+
[JsonSubtypes.KnownSubType(typeof(LinkToPageBlock), BlockType.LinkToPage)]
2627
[JsonSubtypes.KnownSubType(typeof(NumberedListItemBlock), BlockType.NumberedListItem)]
2728
[JsonSubtypes.KnownSubType(typeof(ParagraphBlock), BlockType.Paragraph)]
2829
[JsonSubtypes.KnownSubType(typeof(PDFBlock), BlockType.PDF)]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Notion.Client
4+
{
5+
public class LinkToPageBlock : Block, IColumnChildrenBlock, INonColumnBlock
6+
{
7+
public override BlockType Type => BlockType.LinkToPage;
8+
9+
[JsonProperty("link_to_page")]
10+
public IPageParent LinkToPage { get; set; }
11+
}
12+
}

0 commit comments

Comments
 (0)