Skip to content

Commit dc5cf2c

Browse files
Merge pull request #326 from notion-dotnet/325-add-missing-property-item
Add missing property item
2 parents ed18e1a + e8404c8 commit dc5cf2c

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System.Collections.Generic;
2+
using Newtonsoft.Json;
3+
4+
namespace Notion.Client
5+
{
6+
public class RollupPropertyItem : SimplePropertyItem
7+
{
8+
public override string Type => "rollup";
9+
10+
[JsonProperty("rollup")] public Data Rollup { get; set; }
11+
12+
public class Data
13+
{
14+
[JsonProperty("type")] public string Type { get; set; }
15+
16+
[JsonProperty("function")] public string Function { get; set; }
17+
18+
[JsonProperty("number")] public double? Number { get; set; }
19+
20+
[JsonProperty("date")] public Date Date { get; set; }
21+
22+
[JsonProperty("array")] public IEnumerable<Dictionary<string, object>> Array { get; set; }
23+
24+
[JsonProperty("unsupported")] public Dictionary<string, object> Unsupported { get; set; }
25+
26+
[JsonProperty("incomplete")] public Dictionary<string, object> Incomplete { get; set; }
27+
}
28+
}
29+
}

Src/Notion.Client/Models/PropertyItems/SimplePropertyItem.cs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ namespace Notion.Client
88
[JsonSubtypes.KnownSubType(typeof(UrlPropertyItem), "url")]
99
[JsonSubtypes.KnownSubType(typeof(SelectPropertyItem), "select")]
1010
[JsonSubtypes.KnownSubType(typeof(MultiSelectPropertyItem), "multi_select")]
11+
[JsonSubtypes.KnownSubType(typeof(StatusPropertyItem), "status")]
1112
[JsonSubtypes.KnownSubType(typeof(DatePropertyItem), "date")]
1213
[JsonSubtypes.KnownSubType(typeof(EmailPropertyItem), "email")]
1314
[JsonSubtypes.KnownSubType(typeof(PhoneNumberPropertyItem), "phone_number")]
@@ -22,6 +23,7 @@ namespace Notion.Client
2223
[JsonSubtypes.KnownSubType(typeof(RichTextPropertyItem), "rich_text")]
2324
[JsonSubtypes.KnownSubType(typeof(PeoplePropertyItem), "people")]
2425
[JsonSubtypes.KnownSubType(typeof(RelationPropertyItem), "relation")]
26+
[JsonSubtypes.KnownSubType(typeof(RollupPropertyItem), "rollup")]
2527
public abstract class SimplePropertyItem : IPropertyItemObject
2628
{
2729
public string Object => "property_item";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Notion.Client
4+
{
5+
public class StatusPropertyItem : SimplePropertyItem
6+
{
7+
public override string Type => "status";
8+
9+
[JsonProperty("status")] public SelectOption Status { get; set; }
10+
}
11+
}

0 commit comments

Comments
 (0)