-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #274 from notion-dotnet/226-add-table-block-support
Add support for Table and TableRow block ✨
- Loading branch information
Showing
6 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...lient/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/TableRowUpdateBlock.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace Notion.Client | ||
{ | ||
public class TableRowUpdateBlock : UpdateBlock, IUpdateBlock | ||
{ | ||
[JsonProperty("table_row")] | ||
public Info TableRow { get; set; } | ||
|
||
public class Info | ||
{ | ||
[JsonProperty("cells")] | ||
public IEnumerable<IEnumerable<RichTextTextInput>> Cells { get; set; } | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...n.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/TableUpdateBlock.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Notion.Client | ||
{ | ||
public class TableUpdateBlock : UpdateBlock, IUpdateBlock | ||
{ | ||
[JsonProperty("table")] | ||
public Info Table { get; set; } | ||
|
||
public class Info | ||
{ | ||
[JsonProperty("has_column_header")] | ||
public bool HasColumnHeader { get; set; } | ||
|
||
[JsonProperty("has_row_header")] | ||
public bool HasRowHeader { get; set; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Notion.Client | ||
{ | ||
public class TableBlock : Block, IColumnChildrenBlock, INonColumnBlock | ||
{ | ||
public override BlockType Type => BlockType.Table; | ||
|
||
[JsonProperty("table")] | ||
public TableInfo Table { get; set; } | ||
|
||
public class TableInfo | ||
{ | ||
[JsonProperty("table_width")] | ||
public int TableWidth { get; set; } | ||
|
||
[JsonProperty("has_column_header")] | ||
public bool HasColumnHeader { get; set; } | ||
|
||
[JsonProperty("has_row_header")] | ||
public bool HasRowHeader { get; set; } | ||
|
||
[JsonProperty("children")] | ||
public TableRowBlock Children { get; set; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace Notion.Client | ||
{ | ||
public class TableRowBlock : Block, IColumnChildrenBlock, INonColumnBlock | ||
{ | ||
public override BlockType Type => BlockType.TableRow; | ||
|
||
[JsonProperty("table_row")] | ||
public Info TableRow { get; set; } | ||
|
||
public class Info | ||
{ | ||
[JsonProperty("cells")] | ||
public IEnumerable<IEnumerable<RichTextText>> Cells { get; set; } | ||
} | ||
} | ||
} |