diff --git a/Src/Notion.Client/Models/PropertyItems/RollupPropertyItem.cs b/Src/Notion.Client/Models/PropertyItems/RollupPropertyItem.cs new file mode 100644 index 00000000..3df75fd7 --- /dev/null +++ b/Src/Notion.Client/Models/PropertyItems/RollupPropertyItem.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using Newtonsoft.Json; + +namespace Notion.Client +{ + public class RollupPropertyItem : SimplePropertyItem + { + public override string Type => "rollup"; + + [JsonProperty("rollup")] public Data Rollup { get; set; } + + public class Data + { + [JsonProperty("type")] public string Type { get; set; } + + [JsonProperty("function")] public string Function { get; set; } + + [JsonProperty("number")] public double? Number { get; set; } + + [JsonProperty("date")] public Date Date { get; set; } + + [JsonProperty("array")] public IEnumerable> Array { get; set; } + + [JsonProperty("unsupported")] public Dictionary Unsupported { get; set; } + + [JsonProperty("incomplete")] public Dictionary Incomplete { get; set; } + } + } +} diff --git a/Src/Notion.Client/Models/PropertyItems/SimplePropertyItem.cs b/Src/Notion.Client/Models/PropertyItems/SimplePropertyItem.cs index da753319..50d95184 100644 --- a/Src/Notion.Client/Models/PropertyItems/SimplePropertyItem.cs +++ b/Src/Notion.Client/Models/PropertyItems/SimplePropertyItem.cs @@ -8,6 +8,7 @@ namespace Notion.Client [JsonSubtypes.KnownSubType(typeof(UrlPropertyItem), "url")] [JsonSubtypes.KnownSubType(typeof(SelectPropertyItem), "select")] [JsonSubtypes.KnownSubType(typeof(MultiSelectPropertyItem), "multi_select")] + [JsonSubtypes.KnownSubType(typeof(StatusPropertyItem), "status")] [JsonSubtypes.KnownSubType(typeof(DatePropertyItem), "date")] [JsonSubtypes.KnownSubType(typeof(EmailPropertyItem), "email")] [JsonSubtypes.KnownSubType(typeof(PhoneNumberPropertyItem), "phone_number")] @@ -22,6 +23,7 @@ namespace Notion.Client [JsonSubtypes.KnownSubType(typeof(RichTextPropertyItem), "rich_text")] [JsonSubtypes.KnownSubType(typeof(PeoplePropertyItem), "people")] [JsonSubtypes.KnownSubType(typeof(RelationPropertyItem), "relation")] + [JsonSubtypes.KnownSubType(typeof(RollupPropertyItem), "rollup")] public abstract class SimplePropertyItem : IPropertyItemObject { public string Object => "property_item"; diff --git a/Src/Notion.Client/Models/PropertyItems/StatusPropertyItem.cs b/Src/Notion.Client/Models/PropertyItems/StatusPropertyItem.cs new file mode 100644 index 00000000..46e70108 --- /dev/null +++ b/Src/Notion.Client/Models/PropertyItems/StatusPropertyItem.cs @@ -0,0 +1,11 @@ +using Newtonsoft.Json; + +namespace Notion.Client +{ + public class StatusPropertyItem : SimplePropertyItem + { + public override string Type => "status"; + + [JsonProperty("status")] public SelectOption Status { get; set; } + } +}