-
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 #101 from notion-dotnet/feature/79-add-support-to-…
…update-a-block Add support to update a block 💖
- Loading branch information
Showing
18 changed files
with
203 additions
and
7 deletions.
There are no files selected for viewing
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
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
10 changes: 10 additions & 0 deletions
10
...ent/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/BulletedListItemBlock.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,10 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Notion.Client | ||
{ | ||
public class BulletedListItemUpdateBlock : IUpdateBlock | ||
{ | ||
[JsonProperty("bulleted_list_item")] | ||
public TextContentUpdate BulletedListItem { get; set; } | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...on.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/HeadingOneBlock.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,10 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Notion.Client | ||
{ | ||
public class HeadingOneUpdateBlock : IUpdateBlock | ||
{ | ||
[JsonProperty("heading_1")] | ||
public TextContentUpdate Heading_1 { get; set; } | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/HeadingThreeeBlock.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,10 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Notion.Client | ||
{ | ||
public class HeadingThreeeUpdateBlock : IUpdateBlock | ||
{ | ||
[JsonProperty("heading_3")] | ||
public TextContentUpdate Heading_3 { get; set; } | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...on.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/HeadingTwoBlock.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,10 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Notion.Client | ||
{ | ||
public class HeadingTwoUpdateBlock : IUpdateBlock | ||
{ | ||
[JsonProperty("heading_2")] | ||
public TextContentUpdate Heading_2 { get; set; } | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...otion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/IUpdateBlock.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,6 @@ | ||
namespace Notion.Client | ||
{ | ||
public interface IUpdateBlock | ||
{ | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...ent/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/NumberedListItemBlock.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,10 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Notion.Client | ||
{ | ||
public class NumberedListItemUpdateBlock : IUpdateBlock | ||
{ | ||
[JsonProperty("numbered_list_item")] | ||
public TextContentUpdate NumberedListItem { get; set; } | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...ion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/ParagraphBlock.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,7 @@ | ||
namespace Notion.Client | ||
{ | ||
public class ParagraphUpdateBlock : IUpdateBlock | ||
{ | ||
public TextContentUpdate Paragraph { get; set; } | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
....Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/TextContentUpdate.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,9 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Notion.Client | ||
{ | ||
public class TextContentUpdate | ||
{ | ||
public IEnumerable<RichTextBaseInput> Text { get; set; } | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
Src/Notion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/ToDoBlock.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 System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace Notion.Client | ||
{ | ||
public class ToDoUpdateBlock : IUpdateBlock | ||
{ | ||
[JsonProperty("to_do")] | ||
public Info ToDo { get; set; } | ||
|
||
public class Info | ||
{ | ||
public IEnumerable<RichTextBaseInput> Text { get; set; } | ||
|
||
[JsonProperty("checked")] | ||
public bool IsChecked { get; set; } | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...Notion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/ToggleBlock.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,7 @@ | ||
namespace Notion.Client | ||
{ | ||
public class ToggleUpdateBlock : IUpdateBlock | ||
{ | ||
public TextContentUpdate Toggle { 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
30 changes: 30 additions & 0 deletions
30
Test/Notion.UnitTests/data/blocks/UpdateBlockResponse.json
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,30 @@ | ||
{ | ||
"object": "block", | ||
"id": "9bc30ad4-9373-46a5-84ab-0a7845ee52e6", | ||
"created_time": "2021-03-16T16:31:00.000Z", | ||
"last_edited_time": "2021-03-16T16:32:00.000Z", | ||
"has_children": false, | ||
"type": "to_do", | ||
"to_do": { | ||
"text": [ | ||
{ | ||
"type": "text", | ||
"text": { | ||
"content": "Lacinato kale", | ||
"link": null | ||
}, | ||
"annotations": { | ||
"bold": false, | ||
"italic": false, | ||
"strikethrough": false, | ||
"underline": false, | ||
"code": false, | ||
"color": "default" | ||
}, | ||
"plain_text": "Lacinato kale", | ||
"href": null | ||
} | ||
], | ||
"checked": false | ||
} | ||
} |
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