Skip to content

Commit f7d5449

Browse files
Merge pull request #276 from notion-dotnet/notion-version-2022-02-22
Support Notion-Version 2022-02-22 💖
2 parents 07d09c4 + c9d5103 commit f7d5449

File tree

66 files changed

+1018
-817
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1018
-817
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ Provides the following packages:
4141
dotnet add package Notion.Net
4242
```
4343

44-
> Note: From Nuget 2.0.0 notion client sdk default sets the Notion-Version header to 2021-08-16.
45-
46-
44+
> Note: default Notion-Version used by NuGet package versions
45+
> | Package version | Notion-Version |
46+
> | --- | --- |
47+
> | 3.0.0+ | 2022-02-22 |
48+
> | 2.0.0+ | 2021-08-16 |
49+
> | 1.0.0+ | 2021-05-13 |
4750
4851
## Usage
4952

@@ -113,7 +116,6 @@ var complexFiler = new CompoundFilter(
113116
- [x] Create a database
114117
- [x] Update database
115118
- [x] Retrieve a database
116-
- [x] List databases (Deprecated: use Search API instead)
117119
- [x] Pages
118120
- [x] Retrieve a page
119121
- [x] Create a page

Src/Notion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/BookmarkUpdateBlock.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ public class BookmarkUpdateBlock : IUpdateBlock
88
public bool Archived { get; set; }
99

1010
[JsonProperty("bookmark")]
11-
public Data Bookmark { get; set; }
11+
public Info Bookmark { get; set; }
1212

13-
public class Data
13+
public class Info
1414
{
1515
[JsonProperty("url")]
1616
public string Url { get; set; }

Src/Notion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/BreadcrumbUpdateBlock.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ public class BreadcrumbUpdateBlock : IUpdateBlock
77
public bool Archived { get; set; }
88

99
[JsonProperty("breadcrumb")]
10-
public Data Breadcrumb { get; set; }
10+
public Info Breadcrumb { get; set; }
1111

12-
public class Data
12+
public class Info
1313
{
1414
}
1515

1616
public BreadcrumbUpdateBlock()
1717
{
18-
Breadcrumb = new Data();
18+
Breadcrumb = new Info();
1919
}
2020
}
2121
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
using Newtonsoft.Json;
1+
using System.Collections.Generic;
2+
using Newtonsoft.Json;
23

34
namespace Notion.Client
45
{
56
public class BulletedListItemUpdateBlock : UpdateBlock, IUpdateBlock
67
{
78
[JsonProperty("bulleted_list_item")]
8-
public TextContentUpdate BulletedListItem { get; set; }
9+
public Info BulletedListItem { get; set; }
10+
11+
public class Info
12+
{
13+
[JsonProperty("rich_text")]
14+
public IEnumerable<RichTextBaseInput> RichText { get; set; }
15+
}
916
}
1017
}

Src/Notion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/CalloutUpdateBlock.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public class CalloutUpdateBlock : UpdateBlock, IUpdateBlock
1010

1111
public class Info
1212
{
13-
[JsonProperty("text")]
14-
public IEnumerable<RichTextBaseInput> Text { get; set; }
13+
[JsonProperty("rich_text")]
14+
public IEnumerable<RichTextBaseInput> RichText { get; set; }
1515

1616
[JsonProperty("icon")]
1717
public IPageIcon Icon { get; set; }

Src/Notion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/CodeUpdateBlock.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public class CodeUpdateBlock : UpdateBlock, IUpdateBlock
1010

1111
public class Info
1212
{
13-
[JsonProperty("text")]
14-
public IEnumerable<RichTextBase> Text { get; set; }
13+
[JsonProperty("rich_text")]
14+
public IEnumerable<RichTextBase> RichText { get; set; }
1515

1616
[JsonProperty("language")]
1717
public string Language { get; set; }

Src/Notion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/DividerUpdateBlock.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ public class DividerUpdateBlock : IUpdateBlock
77
public bool Archived { get; set; }
88

99
[JsonProperty("divider")]
10-
public Data Divider { get; set; }
10+
public Info Divider { get; set; }
1111

12-
public class Data
12+
public class Info
1313
{
1414
}
1515

1616
public DividerUpdateBlock()
1717
{
18-
Divider = new Data();
18+
Divider = new Info();
1919
}
2020
}
2121
}

Src/Notion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/EmbedUpdateBlock.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ namespace Notion.Client
55
public class EmbedUpdateBlock : UpdateBlock, IUpdateBlock
66
{
77
[JsonProperty("embed")]
8-
public Data Embed { get; set; }
8+
public Info Embed { get; set; }
99

10-
public class Data
10+
public class Info
1111
{
1212
[JsonProperty("url")]
1313
public string Url { get; set; }

Src/Notion.Client/Api/Blocks/RequestParams/BlocksUpdateParameters/UpdateBlocks/EquationUpdateBlock.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ namespace Notion.Client
55
public class EquationUpdateBlock : UpdateBlock, IUpdateBlock
66
{
77
[JsonProperty("equation")]
8-
public Data Equation { get; set; }
8+
public Info Equation { get; set; }
99

10-
public class Data
10+
public class Info
1111
{
1212
[JsonProperty("expression")]
1313
public string Expression { get; set; }
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
using Newtonsoft.Json;
1+
using System.Collections.Generic;
2+
using Newtonsoft.Json;
23

34
namespace Notion.Client
45
{
56
public class HeadingOneUpdateBlock : UpdateBlock, IUpdateBlock
67
{
78
[JsonProperty("heading_1")]
8-
public TextContentUpdate Heading_1 { get; set; }
9+
public Info Heading_1 { get; set; }
10+
11+
public class Info
12+
{
13+
[JsonProperty("rich_text")]
14+
public IEnumerable<RichTextBaseInput> RichText { get; set; }
15+
}
916
}
1017
}

0 commit comments

Comments
 (0)