Skip to content

Commit 4df48cb

Browse files
Merge pull request #361 from Sphere10/main
Add support for SynchedBlock and `is_toggleable` property in headings
2 parents f5c40c6 + 06ea4f4 commit 4df48cb

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ public class HeadingOneBlock : Block, IColumnChildrenBlock, INonColumnBlock
1313

1414
public override BlockType Type => BlockType.Heading_1;
1515

16-
public override bool HasChildren => false;
17-
1816
public class Info
1917
{
2018
[JsonProperty("rich_text")]
@@ -23,6 +21,9 @@ public class Info
2321
[JsonProperty("color")]
2422
[JsonConverter(typeof(StringEnumConverter))]
2523
public Color? Color { get; set; }
24+
25+
[JsonProperty("is_toggleable")]
26+
public bool IsToggleable { get; set; }
2627
}
2728
}
2829
}

Src/Notion.Client/Models/Blocks/HeadingThreeeBlock.cs renamed to Src/Notion.Client/Models/Blocks/HeadingThreeBlock.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ public class HeadingThreeBlock : Block, IColumnChildrenBlock, INonColumnBlock
1313

1414
public override BlockType Type => BlockType.Heading_3;
1515

16-
public override bool HasChildren => false;
17-
1816
public class Info
1917
{
2018
[JsonProperty("rich_text")]
@@ -23,6 +21,9 @@ public class Info
2321
[JsonProperty("color")]
2422
[JsonConverter(typeof(StringEnumConverter))]
2523
public Color? Color { get; set; }
24+
25+
[JsonProperty("is_toggleable")]
26+
public bool IsToggleable { get; set; }
2627
}
2728
}
2829
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ public class HeadingTwoBlock : Block, IColumnChildrenBlock, INonColumnBlock
1313

1414
public override BlockType Type => BlockType.Heading_2;
1515

16-
public override bool HasChildren => false;
17-
1816
public class Info
1917
{
2018
[JsonProperty("rich_text")]
@@ -23,6 +21,9 @@ public class Info
2321
[JsonProperty("color")]
2422
[JsonConverter(typeof(StringEnumConverter))]
2523
public Color? Color { get; set; }
24+
25+
[JsonProperty("is_toggleable")]
26+
public bool IsToggleable { get; set; }
2627
}
2728
}
2829
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace Notion.Client
2929
[JsonSubtypes.KnownSubTypeAttribute(typeof(ParagraphBlock), BlockType.Paragraph)]
3030
[JsonSubtypes.KnownSubTypeAttribute(typeof(PDFBlock), BlockType.PDF)]
3131
[JsonSubtypes.KnownSubTypeAttribute(typeof(QuoteBlock), BlockType.Quote)]
32+
[JsonSubtypes.KnownSubTypeAttribute(typeof(SyncedBlockBlock), BlockType.SyncedBlock)]
3233
[JsonSubtypes.KnownSubTypeAttribute(typeof(TableBlock), BlockType.Table)]
3334
[JsonSubtypes.KnownSubTypeAttribute(typeof(TableRowBlock), BlockType.TableRow)]
3435
[JsonSubtypes.KnownSubTypeAttribute(typeof(TableOfContentsBlock), BlockType.TableOfContents)]

0 commit comments

Comments
 (0)