Skip to content

Commit 7dbcb77

Browse files
Merge pull request #155 from notion-dotnet/tech/141-add-json-property-attributes-to-all-api-response-and-request-model
Add JsonProperty attributes to all API response & request model
2 parents 4fa6bf5 + f95db70 commit 7dbcb77

File tree

94 files changed

+506
-24
lines changed

Some content is hidden

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

94 files changed

+506
-24
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
namespace Notion.Client
1+
using Newtonsoft.Json;
2+
3+
namespace Notion.Client
24
{
35
public class ParagraphUpdateBlock : IUpdateBlock
46
{
7+
[JsonProperty("paragraph")]
58
public TextContentUpdate Paragraph { get; set; }
69
}
710
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
using System.Collections.Generic;
2+
using Newtonsoft.Json;
23

34
namespace Notion.Client
45
{
56
public class TextContentUpdate
67
{
8+
[JsonProperty("text")]
79
public IEnumerable<RichTextBaseInput> Text { get; set; }
810
}
911
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class ToDoUpdateBlock : IUpdateBlock
1010

1111
public class Info
1212
{
13+
[JsonProperty("text")]
1314
public IEnumerable<RichTextBaseInput> Text { get; set; }
1415

1516
[JsonProperty("checked")]
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
namespace Notion.Client
1+
using Newtonsoft.Json;
2+
3+
namespace Notion.Client
24
{
35
public class ToggleUpdateBlock : IUpdateBlock
46
{
7+
[JsonProperty("toggle")]
58
public TextContentUpdate Toggle { get; set; }
69
}
710
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
using System.Collections.Generic;
2+
using Newtonsoft.Json;
23

34
namespace Notion.Client
45
{
56
// TODO: need an input version of Block
67
public interface IBlocksAppendChildrenBodyParameters
78
{
9+
[JsonProperty("children")]
810
IEnumerable<Block> Children { get; set; }
911
}
1012
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
using System.Collections.Generic;
2+
using Newtonsoft.Json;
23

34
namespace Notion.Client
45
{
56
public interface IDatabasesCreateBodyParameters
67
{
8+
[JsonProperty("parent")]
79
ParentPageInput Parent { get; set; }
10+
11+
[JsonProperty("properties")]
812
Dictionary<string, IPropertySchema> Properties { get; set; }
13+
14+
[JsonProperty("title")]
915
List<RichTextBaseInput> Title { get; set; }
1016
}
1117
}
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1-
namespace Notion.Client
1+
using Newtonsoft.Json;
2+
3+
namespace Notion.Client
24
{
35
public class MentionInput
46
{
7+
[JsonProperty("type")]
58
public string Type { get; set; }
9+
10+
[JsonProperty("user")]
611
public Person User { get; set; }
12+
13+
[JsonProperty("page")]
714
public ObjectId Page { get; set; }
15+
16+
[JsonProperty("database")]
817
public ObjectId Database { get; set; }
18+
19+
[JsonProperty("date")]
920
public DatePropertyValue Date { get; set; }
1021
}
1122
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
using System.Collections.Generic;
2+
using Newtonsoft.Json;
23

34
namespace Notion.Client
45
{
56
public class CheckboxPropertySchema : IPropertySchema
67
{
8+
[JsonProperty("checkbox")]
79
public Dictionary<string, object> Checkbox { get; set; }
810
}
911
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
using System.Collections.Generic;
2+
using Newtonsoft.Json;
23

34
namespace Notion.Client
45
{
56
public class DatePropertySchema : IPropertySchema
67
{
8+
[JsonProperty("date")]
79
public Dictionary<string, object> Date { get; set; }
810
}
911
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
using System.Collections.Generic;
2+
using Newtonsoft.Json;
23

34
namespace Notion.Client
45
{
56
public class EmailPropertySchema : IPropertySchema
67
{
8+
[JsonProperty("email")]
79
public Dictionary<string, object> Email { get; set; }
810
}
911
}

0 commit comments

Comments
 (0)